Skip to content

Commit 16eacb3

Browse files
fix(router-core): consider __root__ in path parsing of trailing underscores (#5262)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7af7c52 commit 16eacb3

Some content is hidden

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

54 files changed

+419
-855
lines changed

e2e/react-start/basic/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"dev:e2e": "vite dev",
99
"build": "vite build && tsc --noEmit",
1010
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
11-
"test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
11+
"test:e2e:spaMode": "rm -rf port*.txt; MODE=spa playwright test --project=chromium",
12+
"test:e2e:ssrMode": "rm -rf port*.txt; playwright test --project=chromium",
13+
"test:e2e": "pnpm run test:e2e:spaMode && pnpm run test:e2e:ssrMode"
1214
},
1315
"dependencies": {
1416
"@tanstack/react-router": "workspace:^",

e2e/react-start/basic/playwright.config.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ import {
33
getDummyServerPort,
44
getTestServerPort,
55
} from '@tanstack/router-e2e-utils'
6+
import { isSpaMode } from 'tests/utils/isSpaMode'
67
import packageJson from './package.json' with { type: 'json' }
78

89
const PORT = await getTestServerPort(packageJson.name)
910
const EXTERNAL_PORT = await getDummyServerPort(packageJson.name)
1011
const baseURL = `http://localhost:${PORT}`
12+
const spaModeCommand = `pnpm build && pnpm dev:e2e --port=${PORT}`
13+
const ssrModeCommand = `pnpm build && pnpm start`
1114

15+
console.log('running in spa mode: ', isSpaMode.toString())
1216
/**
1317
* See https://playwright.dev/docs/test-configuration.
1418
*/
1519
export default defineConfig({
1620
testDir: './tests',
1721
workers: 1,
18-
1922
reporter: [['line']],
2023

2124
globalSetup: './tests/setup/global.setup.ts',
@@ -27,16 +30,25 @@ export default defineConfig({
2730
},
2831

2932
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`,
33+
command: isSpaMode ? spaModeCommand : ssrModeCommand,
3134
url: baseURL,
3235
reuseExistingServer: !process.env.CI,
3336
stdout: 'pipe',
37+
env: {
38+
MODE: process.env.MODE || '',
39+
VITE_NODE_ENV: 'test',
40+
VITE_EXTERNAL_PORT: String(EXTERNAL_PORT),
41+
VITE_SERVER_PORT: String(PORT),
42+
PORT: String(PORT),
43+
},
3444
},
3545

3646
projects: [
3747
{
3848
name: 'chromium',
39-
use: { ...devices['Desktop Chrome'] },
49+
use: {
50+
...devices['Desktop Chrome'],
51+
},
4052
},
4153
],
4254
})

0 commit comments

Comments
 (0)