Skip to content

Commit 1b701e6

Browse files
committed
test: add tests for VALID_TAG_DIRECTORY_SEPARATORS, VERSION_TAG_REGEX, and MODULE_TAG_REGEX
1 parent f13f153 commit 1b701e6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

__tests__/utils/constants.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import {
2+
VALID_TAG_DIRECTORY_SEPARATORS,
3+
VERSION_TAG_REGEX,
4+
MODULE_TAG_REGEX,
25
BRANDING_COMMENT,
36
BRANDING_WIKI,
47
GITHUB_ACTIONS_BOT_NAME,
@@ -11,6 +14,18 @@ import {
1114
import { describe, expect, it } from 'vitest';
1215

1316
describe('utils/constants', () => {
17+
it('should have the correct default separators', () => {
18+
expect(VALID_TAG_DIRECTORY_SEPARATORS).toStrictEqual(['-', '_', '/', '.']);
19+
});
20+
21+
it('should have the correct version tag regex', () => {
22+
expect(VERSION_TAG_REGEX).toStrictEqual(/^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/);
23+
});
24+
25+
it('should have the correct module tag regex', () => {
26+
expect(MODULE_TAG_REGEX).toStrictEqual(/^(.+)([-_/.])(v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*))$/);
27+
});
28+
1429
it('should have the correct GitHub Actions bot name', () => {
1530
expect(GITHUB_ACTIONS_BOT_NAME).toBe('GitHub Actions');
1631
});

0 commit comments

Comments
 (0)