-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js): allow publishable library to run release command
- Loading branch information
Showing
6 changed files
with
501 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { | ||
cleanupProject, | ||
newProject, | ||
runCLI, | ||
runCommandAsync, | ||
uniq, | ||
} from '@nx/e2e/utils'; | ||
|
||
describe('publishable libraries release', () => { | ||
beforeAll(() => { | ||
newProject({ | ||
packages: ['@nx/js'], | ||
}); | ||
}); | ||
afterAll(() => cleanupProject()); | ||
|
||
it('should be able release publishable js library', async () => { | ||
// 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`); | ||
|
||
const jsLib = uniq('js-lib'); | ||
runCLI( | ||
`generate @nx/js:lib ${jsLib} --publishable --importPath=@proj/${jsLib}` | ||
); | ||
|
||
// 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` | ||
); | ||
|
||
let versionOutput = runCLI(`release --first-release`); | ||
versionOutput = runCLI(`release patch`); | ||
|
||
expect(versionOutput).toContain('Executing pre-version command'); | ||
}); | ||
|
||
it('should run nx-release-publish target for all publishable libraries', async () => { | ||
expect(() => { | ||
runCLI(`run-many -t nx-release-publish`); | ||
}).not.toThrow(); | ||
}); | ||
}); |
Oops, something went wrong.