Skip to content

Commit eadeb9d

Browse files
committed
fix: added env variable for Playwright tests
1 parent 9d1188c commit eadeb9d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

next.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/** @type {import('next').NextConfig} */
2+
const isE2E = process.env.PLAYWRIGHT_TEST === '1'
23
const nextConfig = {
34
basePath: process.env.PAGES_BASE_PATH,
45
distDir: 'out',
@@ -8,7 +9,7 @@ const nextConfig = {
89
images: {
910
unoptimized: true,
1011
},
11-
output: 'export',
12+
output: isE2E ? undefined : 'export',
1213
reactStrictMode: true,
1314
trailingSlash: false,
1415
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"test:ui": "vitest --ui",
1212
"test:ci": "vitest --run",
1313
"test:coverage": "vitest --coverage",
14-
"test:e2e": "playwright test",
15-
"test:e2e:ui": "playwright test --ui",
16-
"test:e2e:headed": "playwright test --headed",
14+
"test:e2e": "PLAYWRIGHT_TEST=1 playwright test",
15+
"test:e2e:ui": "PLAYWRIGHT_TEST=1 playwright test --ui",
16+
"test:e2e:headed": "PLAYWRIGHT_TEST=1 playwright test --headed",
1717
"fetch:versions": "npx tsx scripts/fetch-versions.ts",
1818
"fetch:downloads": "npx tsx scripts/fetch-downloads.ts",
1919
"update:data": "npm run fetch:versions && npm run fetch:downloads"

playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ export default defineConfig({
2424
url: 'http://localhost:3000',
2525
reuseExistingServer: !process.env.CI,
2626
timeout: 120000,
27+
env: {
28+
PLAYWRIGHT_TEST: '1',
29+
},
2730
},
2831
});

0 commit comments

Comments
 (0)