Skip to content

Commit

Permalink
Adds tests accidentally removed in #4305
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Jun 30, 2022
1 parent 235f5a7 commit 1d632f0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/yarnpkg-core/tests/Configuration.test.ts
@@ -1,7 +1,7 @@
import {xfs, PortablePath} from '@yarnpkg/fslib';
import NpmPlugin from '@yarnpkg/plugin-npm';
import {xfs, PortablePath} from '@yarnpkg/fslib';
import NpmPlugin from '@yarnpkg/plugin-npm';

import {Configuration, SECRET} from '../sources/Configuration';
import {Configuration, SECRET, TAG_REGEXP} from '../sources/Configuration';

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

describe(`TAG_REGEXP`, () => {
const validTags = [
`canary`,
`latest`,
`next`,
`legacy_v1`,
];

it(`should allow all valid tags`, () => {
const badTags = validTags.filter(tag => !TAG_REGEXP.test(tag));
expect(badTags.length).toBe(0);
});
});

describe(`Configuration`, () => {
it(`should hide secrets`, async () => {
await initializeConfiguration({
Expand Down

0 comments on commit 1d632f0

Please sign in to comment.