forked from snyk/nodejs-lockfile-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: yarn 2 lock file parsing issues snyk#56
- Loading branch information
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,11 +62,21 @@ if (getRuntimeVersion() >= 10) { | |
}); | ||
|
||
test('Should work for patch protocol', async (t) => { | ||
const key = normalizer('left-pad@patch:[email protected]#./my-patch.patch::locator=external-tarball%40workspace%3A.'); | ||
t.deepEqual(key, [ 'left-pad@patch:[email protected]#./my-patch.patch'], 'Resolution is normalized'); | ||
}); | ||
|
||
test('Should work for patch protocol with scope', async (t) => { | ||
const key = normalizer('@types/istanbul-reports@patch:@types/[email protected]#./my-patch.patch::locator=external-tarball%40workspace%3A.'); | ||
t.deepEqual(key, [ '@types/istanbul-reports@patch:@types/[email protected]#./my-patch.patch'], 'Resolution is normalized'); | ||
}); | ||
|
||
test('Should work for builtin patch protocol', async (t) => { | ||
const key = normalizer('fsevents@patch:fsevents@^1.2.7#builtin<compat/fsevents>'); | ||
t.deepEqual(key, [ 'fsevents@^1.2.7'], 'Resolution is normalized'); | ||
}); | ||
|
||
test('Should work for patch protocol - multiple resolutions', async (t) => { | ||
test('Should work for builtin patch protocol - multiple resolutions', async (t) => { | ||
const key = normalizer('fsevents@patch:fsevents@^1.2.7#builtin<compat/fsevents>, fsevents@patch:fsevents@^1.2.6#builtin<compat/fsevents>'); | ||
t.deepEqual(key, [ 'fsevents@^1.2.7', 'fsevents@^1.2.6'], 'Resolution is normalized'); | ||
}); | ||
|