|
1 | 1 | import { expect, request } from '@playwright/test' |
2 | 2 | import { test } from '@tanstack/router-e2e-utils' |
3 | 3 |
|
| 4 | +// Whitelist errors that can occur in CI: |
| 5 | +// - net::ERR_NAME_NOT_RESOLVED: transient network issues |
| 6 | +// - 504 (Outdated Optimize Dep): Vite dependency optimization reload |
| 7 | +const whitelistErrors = [ |
| 8 | + 'Failed to load resource: net::ERR_NAME_NOT_RESOLVED', |
| 9 | + 'Failed to load resource: the server responded with a status of 504', |
| 10 | +] |
| 11 | + |
4 | 12 | test.describe('CSS styles in SSR (dev mode)', () => { |
5 | | - // Whitelist network errors that can occur in CI due to transient network issues |
6 | | - test.use({ |
7 | | - whitelistErrors: [/Failed to load resource: net::ERR_NAME_NOT_RESOLVED/], |
8 | | - }) |
| 13 | + test.use({ whitelistErrors }) |
| 14 | + |
9 | 15 | // Warmup: trigger Vite's dependency optimization before running tests |
10 | 16 | // This prevents "504 (Outdated Optimize Dep)" errors during actual tests |
11 | 17 | test.beforeAll(async ({ baseURL }) => { |
@@ -33,7 +39,7 @@ test.describe('CSS styles in SSR (dev mode)', () => { |
33 | 39 | } |
34 | 40 |
|
35 | 41 | test.describe('with JavaScript disabled', () => { |
36 | | - test.use({ javaScriptEnabled: false }) |
| 42 | + test.use({ javaScriptEnabled: false, whitelistErrors }) |
37 | 43 |
|
38 | 44 | test('global CSS is applied on initial page load', async ({ |
39 | 45 | page, |
|
0 commit comments