mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 09:18:47 +00:00
Move makeTestToken to testing-utils
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -412,3 +412,9 @@ export function createTestConfig(overrides: Partial<Config>): Config {
|
||||
overrides,
|
||||
);
|
||||
}
|
||||
|
||||
export function makeTestToken(length: number = 36) {
|
||||
const chars =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
return chars.repeat(Math.ceil(length / chars.length)).slice(0, length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user