Skip to content

fix: resolve E2E test failures on Node 22+ (import attributes, port conflicts, server readiness)#746

Open
pedrotainha wants to merge 4 commits intooriginjs:mainfrom
pedrotainha:fix/e2e-node22-compat
Open

fix: resolve E2E test failures on Node 22+ (import attributes, port conflicts, server readiness)#746
pedrotainha wants to merge 4 commits intooriginjs:mainfrom
pedrotainha:fix/e2e-node22-compat

Conversation

@pedrotainha
Copy link
Copy Markdown

Fixes #745

Summary

  • Replace deprecated import ... assert with import ... with in 6 rollup config files across examples (Node 22+ removed the assert keyword)
  • Assign unique port ranges to 4 examples to prevent EADDRINUSE when tests run sequentially:
    • webpack-host: 5010/5011
    • simple-react-systemjs: 5020/5021
    • basic-host-remote: 5030/5031
    • simple-react-webpack: 5040/5041
  • Add waitForServer() poll in vitestSetup-serve.ts and vitestSetup-dev.ts to avoid race condition between server startup and page.goto()
  • Increase beforeAll hook timeout from 60s to 120s to accommodate slow builds + server readiness wait
  • Add missing html-webpack-plugin dependency to simple-react-webpack/remote

Test plan

  • pnpm test:e2e-serve — 11 passed, 0 failed, 1 skipped (was 6 passed, 5 failed)
  • pnpm test:unit — 46 passed (no regressions)
  • CI pipeline on Node 18/20 (should also pass since with is supported from Node 18.20+)

Files changed

Import assertions → attributes (6 files):

  • packages/examples/simple-react-systemjs/{host-systemjs,remote-systemjs}/rollup.config.mjs
  • packages/examples/basic-host-remote/rollup-host/rollup.config.mjs
  • packages/examples/simple-react-webpack/host/rollup.config.mjs
  • packages/examples/simple-react-esm/{host-esm,remote-esm}/rollup.config.mjs

Port reassignment + portMap (18 files):

  • packages/examples/webpack-host/ (5 files)
  • packages/examples/simple-react-systemjs/ (5 files)
  • packages/examples/basic-host-remote/ (5 files)
  • packages/examples/simple-react-webpack/ (6 files)

Server readiness + timeout (2 files):

  • packages/examples/vitestSetup-serve.ts
  • packages/examples/vitestSetup-dev.ts

Missing dependency (1 file + lockfile):

  • packages/examples/simple-react-webpack/remote/package.json
  • pnpm-lock.yaml

Move webpack-host from ports 5000/5001 to 5010/5011 so it does not
collide with other examples that also bind to 5000. Add a portMap
lookup in vitestSetup-serve.ts and vitestSetup-dev.ts so the test
harness navigates to the correct host port per example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E tests broken on Node 22+: import assert syntax, EADDRINUSE port collisions, missing html-webpack-plugin

1 participant