Skip to content

Commit 1d632f0

Browse files
committed
Adds tests accidentally removed in #4305
1 parent 235f5a7 commit 1d632f0

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

packages/yarnpkg-core/tests/Configuration.test.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {xfs, PortablePath} from '@yarnpkg/fslib';
2-
import NpmPlugin from '@yarnpkg/plugin-npm';
1+
import {xfs, PortablePath} from '@yarnpkg/fslib';
2+
import NpmPlugin from '@yarnpkg/plugin-npm';
33

4-
import {Configuration, SECRET} from '../sources/Configuration';
4+
import {Configuration, SECRET, TAG_REGEXP} from '../sources/Configuration';
55

66
async function initializeConfiguration<T>(value: {[key: string]: any}, cb: (dir: PortablePath) => Promise<T>) {
77
return await xfs.mktempPromise(async dir => {
@@ -11,6 +11,20 @@ async function initializeConfiguration<T>(value: {[key: string]: any}, cb: (dir:
1111
});
1212
}
1313

14+
describe(`TAG_REGEXP`, () => {
15+
const validTags = [
16+
`canary`,
17+
`latest`,
18+
`next`,
19+
`legacy_v1`,
20+
];
21+
22+
it(`should allow all valid tags`, () => {
23+
const badTags = validTags.filter(tag => !TAG_REGEXP.test(tag));
24+
expect(badTags.length).toBe(0);
25+
});
26+
});
27+
1428
describe(`Configuration`, () => {
1529
it(`should hide secrets`, async () => {
1630
await initializeConfiguration({

0 commit comments

Comments
 (0)