Skip to content

Commit e84d03f

Browse files
committed
test(react-router): add React 19 test variant for multi-version CI coverage, verified known react 19 issue is caught by it
1 parent 511ce70 commit e84d03f

File tree

11 files changed

+6393
-11
lines changed

11 files changed

+6393
-11
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
strategy:
177177
fail-fast: false
178178
matrix:
179-
apps: [reactrouter6]
179+
apps: [reactrouter6-react18, reactrouter6-react19]
180180
needs: [build-react, build-react-router]
181181
runs-on: ubuntu-latest
182182
steps:

.github/workflows/stencil-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jobs:
186186
strategy:
187187
fail-fast: false
188188
matrix:
189-
apps: [reactrouter6]
189+
apps: [reactrouter6-react18, reactrouter6-react19]
190190
needs: [build-react, build-react-router]
191191
runs-on: ubuntu-latest
192192
steps:

packages/react-router/scripts/test_runner.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ cd "$SCRIPT_DIR"
1010
# --skip-build Skip all build steps (reuse existing build artifacts)
1111
# --playwright-only Skip Cypress, run only Playwright
1212
# --spec <pattern> Filter Playwright tests by file path pattern
13+
# --app <name> Test app variant (default: reactrouter6-react18)
1314
# ---------------------------------------------------------------------------
1415
SKIP_BUILD=0
1516
PLAYWRIGHT_ONLY=0
1617
PLAYWRIGHT_SPEC=""
18+
APP_NAME="reactrouter6-react18"
1719

1820
while [[ $# -gt 0 ]]; do
1921
case "$1" in
@@ -33,9 +35,17 @@ while [[ $# -gt 0 ]]; do
3335
PLAYWRIGHT_SPEC="$2"
3436
shift 2
3537
;;
38+
--app)
39+
if [[ -z "$2" || "$2" == --* ]]; then
40+
echo "Error: --app requires a value"
41+
exit 1
42+
fi
43+
APP_NAME="$2"
44+
shift 2
45+
;;
3646
*)
3747
echo "Unknown flag: $1"
38-
echo "Usage: $0 [--skip-build] [--playwright-only] [--spec <pattern>]"
48+
echo "Usage: $0 [--skip-build] [--playwright-only] [--spec <pattern>] [--app <name>]"
3949
exit 1
4050
;;
4151
esac
@@ -62,17 +72,17 @@ if [ "$SKIP_BUILD" = "0" ]; then
6272
npm run build
6373

6474
# Inside packages/react-router/test
65-
echo "Building test app..."
75+
echo "Building test app ($APP_NAME)..."
6676
cd ./test
67-
rm -rf build/reactrouter6 || true
68-
sh ./build.sh reactrouter6
69-
cd build/reactrouter6
77+
rm -rf "build/$APP_NAME" || true
78+
sh ./build.sh "$APP_NAME"
79+
cd "build/$APP_NAME"
7080
echo "Installing dependencies..."
7181
npm install --legacy-peer-deps > npm_install.log 2>&1
7282
npm run sync
7383
else
7484
echo "Skipping build (--skip-build)."
75-
cd ../test/build/reactrouter6
85+
cd "../test/build/$APP_NAME"
7686
fi
7787

7888
# Install Playwright browsers if not already present

packages/react-router/test/apps/reactrouter6/package-lock.json renamed to packages/react-router/test/apps/reactrouter6-react18/package-lock.json

File renamed without changes.

packages/react-router/test/apps/reactrouter6/package.json renamed to packages/react-router/test/apps/reactrouter6-react18/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "react-router-new",
2+
"name": "test-app",
33
"version": "0.0.1",
44
"private": true,
55
"overrides": {
@@ -21,7 +21,7 @@
2121
"react-dom": "^18.2.0",
2222
"react-router": "^6.0.0",
2323
"react-router-dom": "^6.0.0",
24-
"typescript": "^4.4.2"
24+
"typescript": "^5.1.6"
2525
},
2626
"scripts": {
2727
"dev": "vite",

packages/react-router/test/apps/reactrouter6/vite.config.ts renamed to packages/react-router/test/apps/reactrouter6-react18/vite.config.ts

File renamed without changes.

0 commit comments

Comments
 (0)