From c12cf8d49a7955ab2eb48d716481659cf130c336 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Sat, 24 Jan 2026 12:55:32 +0000 Subject: [PATCH] Move `makeTestToken` to `testing-utils` --- src/artifact-scanner.test.ts | 7 +------ src/testing-utils.ts | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) 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); +}