-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc20582
commit 7485bb2
Showing
9 changed files
with
77 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
packages/@yarn-tool/yarnlock-diff/lib/formatter/buildDiffTable002.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/@yarn-tool/yarnlock-diff/test/yarnLockDiff.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { join } from 'path'; | ||
import FastGlob from '@bluelovers/fast-glob'; | ||
import { readFileSync } from 'fs'; | ||
import { buildDiff } from '../lib/diff-service'; | ||
import yarnLockDiff from '../index'; | ||
|
||
describe(`yarnLockDiff`, () => | ||
{ | ||
const __res = join(__dirname, 'fixtures'); | ||
|
||
const files = FastGlob.sync([ | ||
'*.lock', | ||
], { | ||
cwd: join(__res, 'a'), | ||
}) | ||
; | ||
|
||
files.forEach(file => | ||
{ | ||
|
||
test(file, () => | ||
{ | ||
const yarnlock_old = readFileSync(join(__res, 'a', file)); | ||
const yarnlock_new = readFileSync(join(__res, 'b', file)); | ||
|
||
let actual = yarnLockDiff(yarnlock_old, yarnlock_new, { | ||
stripAnsi: true, | ||
}); | ||
|
||
expect(actual).toMatchSnapshot(); | ||
|
||
}); | ||
|
||
}) | ||
; | ||
|
||
}) |