Skip to content

Commit

Permalink
test(semver): update e2e custom preset
Browse files Browse the repository at this point in the history
  • Loading branch information
edbzn committed Dec 22, 2023
1 parent 89270ee commit 6c52dea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ exports[`@jscutlery/semver @jscutlery/semver:version when libs/d changed should
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
## 0.0.0 (yyyy-mm-dd)
## 0.1.0 (yyyy-mm-dd)
### Awesome features
### Awesome features
* **d:** 🚀 new awesome feature xxxxxxx
"
Expand Down
21 changes: 20 additions & 1 deletion packages/semver/src/executors/version/index.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('@jscutlery/semver', () => {
testingWorkspace.installSemver('d', '--preset=conventionalcommits');
testingWorkspace.exec(
`
sed -i 's/"preset": "conventionalcommits"/"preset": { "types": [ { "type": "feat", "section": "Awesome features" } ] }/g' libs/d/project.json
sed -i 's/"preset": "conventionalcommits"/"preset": { "types": [ { "type": "feat", "section": "Awesome features" } ] }/g' libs/d/project.json
`,
);
testingWorkspace.exec(
Expand Down Expand Up @@ -187,6 +187,25 @@ describe('@jscutlery/semver', () => {
testingWorkspace.runNx(`run d:version --noVerify`);
});

it('should commit all changes', () => {
expect(uncommitedChanges(testingWorkspace.root)).toHaveLength(0);
});

it('should tag with version', () => {
expect(getLastTag(testingWorkspace.root)).toBe('d-0.1.0');
});
it('should commit with description', () => {
expect(getLastCommitDescription(testingWorkspace.root)).toBe(
'chore(d): release version 0.1.0',
);
});

it('should bump package version', () => {
expect(
readFile(`${testingWorkspace.root}/libs/d/package.json`),
).toMatch(/"version": "0.1.0"/);
});

it('should generate CHANGELOG.md', () => {
expect(
deterministicChangelog(
Expand Down

0 comments on commit 6c52dea

Please sign in to comment.