forked from mirror/crumbs-original
fix(test): proper e2e test isolation with project dependencies
Add globalSetup to clean test DB before each run. Split Playwright into two projects: auth-setup (serial, runs first) and app (parallel, depends on auth-setup). Skip rate limiting in test environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Fred Cabassut
co-authored by
Claude Opus 4.6
parent
80c6744559
commit
b2634f8b13
@@ -10,6 +10,11 @@ export function checkRateLimit(
|
||||
ip: string,
|
||||
email: string
|
||||
): { allowed: boolean; retryAfter?: number } {
|
||||
// Skip rate limiting in test environment
|
||||
if (process.env.NODE_ENV === 'test' || process.env.PLAYWRIGHT_TEST === '1') {
|
||||
return { allowed: true };
|
||||
}
|
||||
|
||||
const windowStart = new Date(Date.now() - LOCKOUT_MS);
|
||||
|
||||
// Count failed attempts from this IP in the lockout window
|
||||
|
||||
Reference in New Issue
Block a user