Skip to content

Commit

Permalink
fix: return to previous OutOfSync error
Browse files Browse the repository at this point in the history
  • Loading branch information
admons committed Mar 2, 2021
1 parent ea6a917 commit cce5875
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/parsers/lock-parser-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export abstract class LockParserBase implements LockfileParser {
// TODO: also check the package version
// for a stricter check
if (strict) {
throw new OutOfSyncError(depName, this.type);
throw new OutOfSyncError(dep.name, this.type);
}
depTree.dependencies[dep.name] = createDepTreeDepFromDep(dep);
if (!depTree.dependencies[dep.name].labels) {
Expand Down
4 changes: 2 additions & 2 deletions test/lib/yarn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const SCENARIOS_REJECTED = [
{
name: 'Parse yarn.lock with missing dependency',
workspace: 'missing-deps-in-lock',
expectedError: new OutOfSyncError('uptime@1.4.7', LockfileType.yarn),
expectedError: new OutOfSyncError('uptime', LockfileType.yarn),
},
{
name: 'Parse invalid yarn.lock',
Expand All @@ -107,7 +107,7 @@ const SCENARIOS_REJECTED = [
{
name: 'Out of sync yarn.lock strict mode',
workspace: 'out-of-sync',
expectedError: new OutOfSyncError('lodash@4.17.11', LockfileType.yarn),
expectedError: new OutOfSyncError('lodash', LockfileType.yarn),
},
];

Expand Down

0 comments on commit cce5875

Please sign in to comment.