-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Disable updating peer dependencies when updatePeerDependencies is false. #2270
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,25 @@ describe('PackageJson', () => { | |
}); | ||
|
||
it('updates dependency versions', async () => { | ||
const oldContent = readFileSync( | ||
resolve(fixturesPath, './package-with-dependencies.json'), | ||
'utf8' | ||
); | ||
const versionsMap: VersionsMap = new Map(); | ||
versionsMap.set('camelcase', Version.parse('6.0.0')); | ||
versionsMap.set('chai', Version.parse('4.2.1')); | ||
versionsMap.set('foo', Version.parse('0.1.0')); | ||
versionsMap.set('bar', Version.parse('2.3.4')); | ||
const packageJson = new PackageJson({ | ||
version: Version.parse('14.0.0'), | ||
versionsMap, | ||
updatePeerDependencies: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test implicitly dependended on the updater always updating the peer dependencies. So it was updated and produces the same output. |
||
}); | ||
const newContent = packageJson.updateContent(oldContent); | ||
snapshot(newContent.replace(/\r\n/g, '\n')); | ||
}); | ||
|
||
it('does not update peer dependencies by default', async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New test which does not update peer dependencies. |
||
const oldContent = readFileSync( | ||
resolve(fixturesPath, './package-with-dependencies.json'), | ||
'utf8' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test that validates the peer dependency is not updated.