(diff: string)
| 21 | import { setupFixtureRepository } from '../helpers/repositories' |
| 22 | |
| 23 | async function parseDiff(diff: string): Promise<ITextDiff> { |
| 24 | const parser = new DiffParser() |
| 25 | const rawDiff = parser.parse(diff) |
| 26 | const repository = new Repository('', -1, null, false) |
| 27 | const fileChange = new FileChange('file.txt', { |
| 28 | kind: AppFileStatusKind.Modified, |
| 29 | }) |
| 30 | const output = await convertDiff( |
| 31 | repository, |
| 32 | fileChange, |
| 33 | rawDiff, |
| 34 | 'HEAD', |
| 35 | 'HEAD' |
| 36 | ) |
| 37 | assert.equal(output.kind, DiffType.Text) |
| 38 | return output as ITextDiff |
| 39 | } |
| 40 | |
| 41 | describe('patch formatting', () => { |
| 42 | describe('formatPatchesForModifiedFile', () => { |
no test coverage detected