-
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
534 additions
and
508 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,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'); | ||
}); | ||
}); |
Oops, something went wrong.