diff --git a/tests/support/logPrefix.ts b/tests/support/logPrefix.ts index 8de5b7a96..a517618f8 100644 --- a/tests/support/logPrefix.ts +++ b/tests/support/logPrefix.ts @@ -21,15 +21,14 @@ const availableColors: ColorName[] = [ "cyan", ]; +let nextColorIndex = 0; + const assignedColors: Record = {}; export function logPrefix(label: string): string { if (assignedColors[label] === undefined) { - const color = availableColors.pop(); - if (!color) { - throw new Error("We're out of colors. 🤷"); - } - + const color = availableColors[nextColorIndex]; + nextColorIndex = (nextColorIndex + 1) % availableColors.length; assignedColors[label] = color; }