Skip to content

Commit fbb8ce5

Browse files
committed
chore: fix unit test
1 parent 4bad6ad commit fbb8ce5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test-lib/cli.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ describe('command line interface', () => {
2828
})
2929

3030
test('should output version', async () => {
31-
expect(await run(`node "${cli}" --version`)).toBe('0.0.0')
32-
expect(await run(`node "${cli}" -v`)).toBe('0.0.0')
31+
// a version number like 0.0.0 or 3.1.0
32+
const versionRegex = /^\d+\.\d+\.\d+$/
33+
34+
expect(await run(`node "${cli}" --version`)).toMatch(versionRegex)
35+
expect(await run(`node "${cli}" -v`)).toMatch(versionRegex)
3336
})
3437

3538
test('should output help', async () => {

0 commit comments

Comments
 (0)