From d9bcd150e7298d5bcaf6f543e7dbf18af3dce626 Mon Sep 17 00:00:00 2001 From: "k.hiro1818" Date: Sun, 1 Nov 2026 13:14:34 +0000 Subject: [PATCH] test: drop the redundant crypto spread in the fallback ID test oxlint flagged `{ ...(prevCrypto ?? {}) }` with unicorn/no-useless-fallback-in-spread: object spread already ignores null and undefined. `prevCrypto` is the beforeEach stub that only has `randomUUID`, so the spread never preserved other properties as the comment claimed. Stub `{ randomUUID: undefined }` directly instead. Co-Authored-By: Claude Opus 5.5 --- src/test/lib/utils/auth_forms.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/lib/utils/auth_forms.test.ts b/src/test/lib/utils/auth_forms.test.ts index 049116d80..faa1cfffb 100644 --- a/src/test/lib/utils/auth_forms.test.ts +++ b/src/test/lib/utils/auth_forms.test.ts @@ -219,9 +219,8 @@ describe('auth_forms', () => { }); test('expect to use fallback ID generation when crypto.randomUUID is unavailable', async () => { - // Mock crypto.randomUUID to be undefined (preserve other properties) - const prevCrypto = globalThis.crypto; - vi.stubGlobal('crypto', { ...(prevCrypto ?? {}), randomUUID: undefined }); + // Drop randomUUID to force the timestamp-based fallback ID + vi.stubGlobal('crypto', { randomUUID: undefined }); vi.mocked(superValidate).mockRejectedValueOnce(new Error('Primary strategy failed'));