Skip to content

The agent that grows with you

test(web): make attach-token fixtures deterministic

brooklyn!3be2320a8da3
diff --git a/web/src/lib/pty-attach-token.test.ts b/web/src/lib/pty-attach-token.test.ts
index 2f2c7e91fe7..2035edefd27 100644
--- a/web/src/lib/pty-attach-token.test.ts
+++ b/web/src/lib/pty-attach-token.test.ts
@@ -74,9 +74,11 @@ async function openTab(
}
beforeEach(() => {
+ // Keep mints distinct across tabs; reset the sequence only between tests.
+ let nextByte = 0;
vi.stubGlobal("crypto", {
getRandomValues: (values: Uint8Array) => {
- values.fill(Math.floor(Math.random() * 256));
+ values.fill(++nextByte);
return values;
},
});