Skip to content

Commit

Permalink
add the test for vite in examples/cloudflare-workers
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Nov 20, 2024
1 parent 887cf11 commit d92c8c2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/cloudflare-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"start": "wrangler dev",
"typecheck": "tsc",
"preview": "npm run build && wrangler dev",
"test:e2e:vite": "playwright test -c playwright-vite.config.ts e2e.test.ts",
"test:e2e:workers": "npm run build && playwright test -c playwright-workers.config.ts e2e.test.ts"
},
"dependencies": {
Expand Down
26 changes: 26 additions & 0 deletions examples/cloudflare-workers/playwright-vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig, devices } from '@playwright/test'

const port = 6173

export default defineConfig({
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
use: {
baseURL: `http://localhost:${port.toString()}`,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
timeout: 5000,
retries: 2,
},
],
webServer: {
command: `npm exec vite -- --port ${port.toString()} -c ./vite.config.ts`,
port,
reuseExistingServer: !process.env.CI,
},
})

0 comments on commit d92c8c2

Please sign in to comment.