Skip to content

Commit efc7fbf

Browse files
committed
fix version tests
1 parent 883f019 commit efc7fbf

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

__tests__/version.test.js

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
import {VERSION} from '../src/version.js'
2-
import {vi, expect, describe, test, beforeEach} from 'vitest'
3-
4-
describe('VERSION constant', () => {
5-
const versionRegex = /^v(\d+)\.(\d+)\.(\d+)(?:-rc\.(\d+))?$/
6-
7-
it('should match the version pattern', () => {
8-
expect(VERSION).toMatch(versionRegex)
9-
})
10-
11-
it('should validate v1.0.0', () => {
12-
const version = 'v1.0.0'
13-
expect(version).toMatch(versionRegex)
14-
})
15-
16-
it('should validate v4.5.1', () => {
17-
const version = 'v4.5.1'
18-
expect(version).toMatch(versionRegex)
19-
})
20-
21-
it('should validate v10.123.44', () => {
22-
const version = 'v10.123.44'
23-
expect(version).toMatch(versionRegex)
24-
})
25-
26-
it('should validate v1.1.1-rc.1', () => {
27-
const version = 'v1.1.1-rc.1'
28-
expect(version).toMatch(versionRegex)
29-
})
30-
31-
it('should validate v15.19.4-rc.35', () => {
32-
const version = 'v15.19.4-rc.35'
33-
expect(version).toMatch(versionRegex)
34-
})
2+
import {expect, test} from 'vitest'
3+
4+
const versionRegex = /^v(\d+)\.(\d+)\.(\d+)(?:-rc\.(\d+))?$/
5+
6+
test('VERSION constant should match the version pattern', () => {
7+
expect(VERSION).toMatch(versionRegex)
8+
})
9+
10+
test('should validate v1.0.0', () => {
11+
const version = 'v1.0.0'
12+
expect(version).toMatch(versionRegex)
3513
})
14+
15+
test('should validate v4.5.1', () => {
16+
const version = 'v4.5.1'
17+
expect(version).toMatch(versionRegex)
18+
})
19+
20+
test('should validate v10.123.44', () => {
21+
const version = 'v10.123.44'
22+
expect(version).toMatch(versionRegex)
23+
})
24+
25+
test('should validate v1.1.1-rc.1', () => {
26+
const version = 'v1.1.1-rc.1'
27+
expect(version).toMatch(versionRegex)
28+
})
29+
30+
test('should validate v15.19.4-rc.35', () => {
31+
const version = 'v15.19.4-rc.35'
32+
expect(version).toMatch(versionRegex)
33+
})
34+

0 commit comments

Comments
 (0)