Skip to content

Commit 6bce169

Browse files
committed
fix(tests): add a new test for a command
1 parent 6d33ba3 commit 6bce169

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,23 @@ jobs:
5757
const allItems = czList.stdout.trim().split('\n');
5858
const result = allItems.includes(extraRequirements);
5959
assert.ok(result, `Expected ${extraRequirements} to be included in the list of installed cz plugins, but it was not.`);
60+
test-get-changelog:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v5
64+
- uses: ./
65+
- name: Build changelog
66+
env:
67+
GIVEN_VERSION: "v0.1.0"
68+
run: |
69+
cz changelog --dry-run "${GIVEN_VERSION}" > .changelog.md
70+
- name: Verify changelog content
71+
uses: actions/github-script@v8
72+
with:
73+
script: |
74+
const assert = require('node:assert/strict');
75+
const fs = require('node:fs');
76+
const changelogContent = fs.readFileSync('.changelog.md', 'utf8');
77+
assert.ok(changelogContent.includes('v0.1.0 (2025-11-20)'), 'Expected changelog to contain version 0.1.0');
78+
assert.ok(changelogContent.includes('### Feat'), 'Expected changelog to contain a header for features');
79+
assert.ok(changelogContent.includes('### Fix'), 'Expected changelog to contain a header for fixes');

0 commit comments

Comments
 (0)