|
1 | 1 | 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) |
35 | 13 | }) |
| 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