Skip to content

Commit

Permalink
test(release): test that peer deps don't get broken
Browse files Browse the repository at this point in the history
This is a test commit to try to get the e2e tests to actually run on it.
it SHOULD NOT BE MERGED.
  • Loading branch information
simon-abbott committed Jan 23, 2025
1 parent 123602c commit 261bac0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions e2e/release/src/lock-file-updates.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
checkFilesExist,
cleanupProject,
newProject,
readJson,
runCLI,
runCommand,
uniq,
Expand Down Expand Up @@ -154,6 +156,42 @@ describe('nx release lock file updates', () => {
`);
});

it('should not mess with peer dependencies when package manager is npm', async () => {
initializeProject('npm');

updateJson('package.json', (json) => {
json.workspaces = [pkg1, pkg2, pkg3];
return json;
});

updateJson(`${pkg1}/package.json`, (json) => {
json.peerDependencies = {
semver: '^7.3.2',
};
return json;
});

runCommand(`npm install`);

expect(() => {
checkFilesExist('node_modules/semver/package.json');
runCommand('npm ci');
}).not.toThrow();

// workaround for NXC-143
runCLI('reset');

runCommand(`git add .`);
runCommand(`git commit -m "chore: initial commit"`);

runCLI(`release version 999.9.9`);

expect(() => {
runCommand('npm ci');
checkFilesExist('node_modules/semver/package.json');
}).not.toThrow();
});

it('should not update lock file when package manager is yarn classic', async () => {
initializeProject('yarn');

Expand Down

0 comments on commit 261bac0

Please sign in to comment.