Skip to content

Commit

Permalink
fix(resolutions): Warn instead of erroring if unmatched dependency ma…
Browse files Browse the repository at this point in the history
…tches resolutions (#4835)

Summary

Fixes #4825.

When running yarn check do not error if the unmatched dependency matches the override in resolutions field of package.json. Just warn about the mismatch

Test plan

New test case added.
  • Loading branch information
dreyks authored and kaylieEB committed Nov 20, 2017
1 parent 02f7de6 commit f69cdda
Show file tree
Hide file tree
Showing 14 changed files with 577 additions and 1 deletion.
18 changes: 18 additions & 0 deletions __tests__/commands/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@ test.concurrent('should ignore bundled dependencies', async (): Promise<void> =>
);
});

test.concurrent('should warn about mismatched dependencies if they match resolutions', async (): Promise<void> => {
let mismatchError = false;
let stdout = '';
try {
await runCheck([], {}, 'resolutions', (config, reporter, check, getStdout) => {
stdout = getStdout();
});
} catch (err) {
mismatchError = true;
}
expect(mismatchError).toEqual(false);
expect(
stdout.search(
`warning.*"repeat-string@1.4.0" is incompatible with requested version "pad-left#repeat-string@\\^1.5.4"`,
),
).toBeGreaterThan(-1);
});

test.concurrent('--integrity should throw an error if top level patterns do not match', async (): Promise<void> => {
let integrityError = false;
try {
Expand Down
18 changes: 18 additions & 0 deletions __tests__/fixtures/check/resolutions/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions __tests__/fixtures/check/resolutions/node_modules/pad-left/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 134 additions & 0 deletions __tests__/fixtures/check/resolutions/node_modules/pad-left/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f69cdda

Please sign in to comment.