Skip to content

Commit e04cd26

Browse files
committed
🚨 Fix broken tests (#2446)
1 parent 5baeaea commit e04cd26

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/test/lib/utils/auth_forms.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,13 @@ describe('auth_forms', () => {
278278

279279
await createAuthFormWithFallback();
280280

281-
expect(mockConsoleWarn).toHaveBeenCalledWith('Error:', 'Test error message');
281+
expect(mockConsoleWarn).toHaveBeenCalledWith(
282+
'Create authForm strategy: Failed to (Basic case) Use standard superValidate',
283+
);
284+
// Error objects are converted to string and include stack trace
285+
expect(mockConsoleWarn).toHaveBeenCalledWith(
286+
expect.stringContaining('Error: Test error message'),
287+
);
282288
});
283289

284290
// Note: "expect to not log warnings in production mode" was removed
@@ -293,9 +299,10 @@ describe('auth_forms', () => {
293299

294300
await createAuthFormWithFallback();
295301

296-
// Expect to warn about strategy failure but not log error message for non-Error objects
297-
expect(mockConsoleWarn).toHaveBeenCalled();
298-
expect(mockConsoleWarn).not.toHaveBeenCalledWith('Error:', expect.anything());
302+
expect(mockConsoleWarn).toHaveBeenCalledWith(
303+
'Create authForm strategy: Failed to (Basic case) Use standard superValidate',
304+
);
305+
expect(mockConsoleWarn).toHaveBeenCalledWith('String error');
299306
});
300307
});
301308

0 commit comments

Comments
 (0)