Skip to content

Commit c12cf8d

Browse files
committed
Move makeTestToken to testing-utils
1 parent 0fcbec3 commit c12cf8d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/artifact-scanner.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ import {
1515
checkExpectedLogMessages,
1616
getRecordingLogger,
1717
LoggedMessage,
18+
makeTestToken,
1819
} from "./testing-utils";
1920

20-
function makeTestToken(length: number = 36) {
21-
const chars =
22-
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
23-
return chars.repeat(Math.ceil(length / chars.length)).slice(0, length);
24-
}
25-
2621
test("makeTestToken", (t) => {
2722
t.is(makeTestToken().length, 36);
2823
t.is(makeTestToken(255).length, 255);

src/testing-utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,9 @@ export function createTestConfig(overrides: Partial<Config>): Config {
412412
overrides,
413413
);
414414
}
415+
416+
export function makeTestToken(length: number = 36) {
417+
const chars =
418+
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
419+
return chars.repeat(Math.ceil(length / chars.length)).slice(0, length);
420+
}

0 commit comments

Comments
 (0)