Skip to content

Commit

Permalink
fix(js): allow publishable library to run release command
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jan 30, 2025
1 parent 10c14b6 commit a71555f
Show file tree
Hide file tree
Showing 6 changed files with 534 additions and 508 deletions.
38 changes: 38 additions & 0 deletions e2e/release/src/publishable-libraries-release.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {
cleanupProject,
newProject,
runCLI,
runCommandAsync,
uniq,
} from '@nx/e2e/utils';

describe('publishable libraries release', () => {
beforeAll(async () => {
newProject({
packages: ['@nx/js'],
});

// Normalize git committer information so it is deterministic in snapshots
await runCommandAsync(`git config user.email "[email protected]"`);
await runCommandAsync(`git config user.name "Test"`);
// Create a baseline version tag
await runCommandAsync(`git tag v0.0.0`);

// We need a valid git origin to exist for the commit references to work (and later the test for createRelease)
await runCommandAsync(
`git remote add origin https://github.com/nrwl/fake-repo.git`
);
});
afterAll(() => cleanupProject());

it('should be able to release publishable js library', async () => {
const jsLib = uniq('js-lib');
runCLI(
`generate @nx/js:lib ${jsLib} --publishable --importPath=@proj/${jsLib}`
);

let versionOutput = runCLI(`release --first-release`);
versionOutput = runCLI(`release patch`);
expect(versionOutput).toContain('Executing pre-version command');
});
});
Loading

0 comments on commit a71555f

Please sign in to comment.