Skip to content

Commit 66a2e0a

Browse files
committed
Remove mock crypto.subtle.digest().
I'm not sure why Claude decided to mock this, or why it doesn't work, but deleting the mock fixes almost all of the tests...
1 parent e671d28 commit 66a2e0a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

__tests__/oauth-provider.test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -219,25 +219,6 @@ function createMockEnv() {
219219
};
220220
}
221221

222-
// Mock for crypto.subtle.digest to ensure consistent token IDs in tests
223-
vi.spyOn(crypto.subtle, 'digest').mockImplementation(async (algorithm, data) => {
224-
// For testing, we'll just return a predictable hash based on data length
225-
// This is not cryptographically secure, but works for tests
226-
const array = new Uint8Array(32); // SHA-256 produces 32 bytes
227-
const view = new DataView(data);
228-
229-
// Fill array with a pattern based on input
230-
for (let i = 0; i < array.length; i++) {
231-
if (i < view.byteLength) {
232-
array[i] = view.getUint8(i % view.byteLength);
233-
} else {
234-
array[i] = i % 256;
235-
}
236-
}
237-
238-
return array.buffer;
239-
});
240-
241222
describe('OAuthProvider', () => {
242223
let oauthProvider: OAuthProvider;
243224
let mockEnv: ReturnType<typeof createMockEnv>;

0 commit comments

Comments
 (0)