Skip to content

Commit 0876b6a

Browse files
committed
Add test to check warning not on stable version
1 parent 4de1335 commit 0876b6a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

shared/github-scripts/changelog-release-helper.unit.test.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ describe('Changelog release helper', () => {
8080
)
8181
})
8282

83+
it('does not display a warning when the change is a stable release', () => {
84+
jest.mocked(fs.readFileSync).mockReturnValue(`
85+
## Unreleased
86+
87+
### Fixes
88+
89+
Bing bong
90+
91+
## v3.1.0 (Beta feature release)
92+
`)
93+
94+
updateChangelog('3.1.1', '3.1.0')
95+
expect(fs.writeFileSync).not.toHaveBeenCalledWith(
96+
'./CHANGELOG.md',
97+
expect.stringContaining('> [!WARNING]')
98+
)
99+
})
100+
83101
it('does not change the changelog if the provided version is an internal pre-release', () => {
84102
const consoleLogSpy = jest.spyOn(console, 'log')
85103

0 commit comments

Comments
 (0)