Skip to content

Commit ae5fa3e

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

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,25 @@ 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+
with:
65+
fetch-depth: 0
66+
- uses: ./
67+
- name: Build changelog
68+
env:
69+
GIVEN_VERSION: "v0.1.0"
70+
run: |
71+
cz changelog --dry-run "${GIVEN_VERSION}" > .changelog.md
72+
- name: Verify changelog content
73+
uses: actions/github-script@v8
74+
with:
75+
script: |
76+
const assert = require('node:assert/strict');
77+
const fs = require('node:fs');
78+
const changelogContent = fs.readFileSync('.changelog.md', 'utf8');
79+
assert.ok(changelogContent.includes('v0.1.0 (2025-11-20)'), 'Expected changelog to contain version 0.1.0');
80+
assert.ok(changelogContent.includes('### Feat'), 'Expected changelog to contain a header for features');
81+
assert.ok(changelogContent.includes('### Fix'), 'Expected changelog to contain a header for fixes');

0 commit comments

Comments
 (0)