Skip to content

Commit d92c8c2

Browse files
committed
add the test for vite in examples/cloudflare-workers
1 parent 887cf11 commit d92c8c2

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

examples/cloudflare-workers/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"start": "wrangler dev",
1111
"typecheck": "tsc",
1212
"preview": "npm run build && wrangler dev",
13+
"test:e2e:vite": "playwright test -c playwright-vite.config.ts e2e.test.ts",
1314
"test:e2e:workers": "npm run build && playwright test -c playwright-workers.config.ts e2e.test.ts"
1415
},
1516
"dependencies": {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
3+
const port = 6173
4+
5+
export default defineConfig({
6+
fullyParallel: true,
7+
forbidOnly: !!process.env.CI,
8+
retries: process.env.CI ? 2 : 0,
9+
workers: process.env.CI ? 1 : undefined,
10+
use: {
11+
baseURL: `http://localhost:${port.toString()}`,
12+
},
13+
projects: [
14+
{
15+
name: 'chromium',
16+
use: { ...devices['Desktop Chrome'] },
17+
timeout: 5000,
18+
retries: 2,
19+
},
20+
],
21+
webServer: {
22+
command: `npm exec vite -- --port ${port.toString()} -c ./vite.config.ts`,
23+
port,
24+
reuseExistingServer: !process.env.CI,
25+
},
26+
})

0 commit comments

Comments
 (0)