diff --git a/src/artifact-scanner.test.ts b/src/artifact-scanner.test.ts index c19676fb2..137738201 100644 --- a/src/artifact-scanner.test.ts +++ b/src/artifact-scanner.test.ts @@ -15,14 +15,9 @@ import { checkExpectedLogMessages, getRecordingLogger, LoggedMessage, + makeTestToken, } from "./testing-utils"; -function makeTestToken(length: number = 36) { - const chars = - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - return chars.repeat(Math.ceil(length / chars.length)).slice(0, length); -} - test("makeTestToken", (t) => { t.is(makeTestToken().length, 36); t.is(makeTestToken(255).length, 255); diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 66a6c25fb..bee7d1ada 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -412,3 +412,9 @@ export function createTestConfig(overrides: Partial): Config { overrides, ); } + +export function makeTestToken(length: number = 36) { + const chars = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + return chars.repeat(Math.ceil(length / chars.length)).slice(0, length); +}