Skip to content

Commit 410fdf8

Browse files
authored
test(solid-start): add virtual-routes e2e suite (#5556)
1 parent 5128836 commit 410fdf8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1119
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
node_modules
2+
package-lock.json
3+
yarn.lock
4+
5+
.DS_Store
6+
.cache
7+
.env
8+
.vercel
9+
.output
10+
11+
/build/
12+
/api/
13+
/server/build
14+
/public/build
15+
# Sentry Config File
16+
.env.sentry-build-plugin
17+
/test-results/
18+
/playwright-report/
19+
/blob-report/
20+
/playwright/.cache/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/build
2+
**/public
3+
pnpm-lock.yaml
4+
routeTree.gen.ts
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "tanstack-solid-start-e2e-virtual-routes",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev --port 3000",
8+
"dev:e2e": "vite dev",
9+
"build": "vite build && tsc --noEmit",
10+
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
11+
"test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
12+
},
13+
"dependencies": {
14+
"@tanstack/solid-router": "workspace:^",
15+
"@tanstack/solid-router-devtools": "workspace:^",
16+
"@tanstack/solid-start": "workspace:^",
17+
"@tanstack/virtual-file-routes": "workspace:^",
18+
"solid-js": "^1.9.5",
19+
"redaxios": "^0.5.1",
20+
"tailwind-merge": "^2.6.0",
21+
"vite": "^7.1.7",
22+
"zod": "^3.24.2"
23+
},
24+
"devDependencies": {
25+
"@playwright/test": "^1.50.1",
26+
"@tanstack/router-e2e-utils": "workspace:^",
27+
"@types/node": "^22.10.2",
28+
"vite-plugin-solid": "^2.11.9",
29+
"autoprefixer": "^10.4.20",
30+
"combinate": "^1.1.11",
31+
"postcss": "^8.5.1",
32+
"srvx": "^0.8.6",
33+
"tailwindcss": "^3.4.17",
34+
"typescript": "^5.7.2",
35+
"vite-tsconfig-paths": "^5.1.4"
36+
}
37+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
import {
3+
getDummyServerPort,
4+
getTestServerPort,
5+
} from '@tanstack/router-e2e-utils'
6+
import packageJson from './package.json' with { type: 'json' }
7+
8+
const PORT = await getTestServerPort(packageJson.name)
9+
const EXTERNAL_PORT = await getDummyServerPort(packageJson.name)
10+
const baseURL = `http://localhost:${PORT}`
11+
12+
/**
13+
* See https://playwright.dev/docs/test-configuration.
14+
*/
15+
export default defineConfig({
16+
testDir: './tests',
17+
workers: 1,
18+
19+
reporter: [['line']],
20+
21+
globalSetup: './tests/setup/global.setup.ts',
22+
globalTeardown: './tests/setup/global.teardown.ts',
23+
24+
use: {
25+
/* Base URL to use in actions like `await page.goto('/')`. */
26+
baseURL,
27+
},
28+
29+
webServer: {
30+
command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} PORT=${PORT} pnpm start`,
31+
url: baseURL,
32+
reuseExistingServer: !process.env.CI,
33+
stdout: 'pipe',
34+
},
35+
36+
projects: [
37+
{
38+
name: 'chromium',
39+
use: { ...devices['Desktop Chrome'] },
40+
},
41+
],
42+
})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}
29.3 KB
Loading
107 KB
Loading
26.6 KB
Loading
832 Bytes
Loading
2.07 KB
Loading

0 commit comments

Comments
 (0)