mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Added .getLineDiffs
This commit is contained in:
@@ -500,7 +500,6 @@ describe('GitRepositoryAsync', () => {
|
||||
describe('.getConfigValue(key, path)', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copyRepository()
|
||||
console.log(workingDirectory)
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
@@ -518,7 +517,6 @@ describe('GitRepositoryAsync', () => {
|
||||
describe('.checkoutReference(reference, create)', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copyRepository()
|
||||
console.log(workingDirectory)
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
@@ -534,4 +532,19 @@ describe('GitRepositoryAsync', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getLineDiffs(path, text)', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copyRepository()
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
it('can get the line diff', async () => {
|
||||
const {oldStart, newStart, oldLines, newLines} = await repo.getLineDiffs('a.txt', 'hi there')
|
||||
expect(oldStart).toBe(0)
|
||||
expect(oldLines).toBe(0)
|
||||
expect(newStart).toBe(1)
|
||||
expect(newLines).toBe(1)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user