-
Couldn't load subscription status.
- Fork 819
test(bundler): migrate bundler tests from Karma to Jest + Puppeteer #6436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…S config\n\n- Serve Vite dist via Node static server (parity with Karma)\n- Real browser with Puppeteer; wait for .hydrated before asserting\n- Restore ts-jest config and explicit TS types\n- Keep node: imports and cross-platform clean scripts
…CI/local stability
…tation icons to jobs
…n- Force public registry and disable always-auth\n- Delete inherited auth token for registry\n- Write clean ~/.npmrc for job
… unsupported option errors\n\n- Avoid 'always-auth' setter; write exact keys to ~/.npmrc\n- Keep public registry and blank token
…to avoid E401\n\n- Write .npmrc in test/bundler and vite-bundle-test\n- Export NPM_* env vars to ensure no token is used
… flags to avoid E401 during npm ci
…y at npm ci call sites
…ning bundler tests
… public npmrc and cleared tokens
…ean userconfig and explicit registry
…en-free .npmrc (option A)
…running Jest on compiled output (no ts-jest install)
… compiled spec can import it
…stall chrome) to satisfy runtime
- Remove debug logging from vite-bundle.spec.ts (test is stable) - Reduce wait timeouts back to 10s (original timeouts sufficient) - Add .gitignore for CI-generated artifacts (dist-spec, jest.config.ci.js, tsconfig.test.json) - Remove redundant puppeteer install step from CI workflow (already in root deps) - Simplify Chrome download step to use existing puppeteer installation
Reinstall puppeteer explicitly before downloading Chrome to ensure
puppeteer-core is properly installed. In some CI environments, npm ci
doesn't correctly install peer dependencies, leading to module
resolution errors when Jest tries to require('puppeteer').
|
@johnjenkins tried a different approach. |
Sorry - pipelines are not my strong-suite :/ |
Mine neither. I'll wait for some feedback on this PR from the community. Cheers |
Replace Karma (Jasmine) bundler tests with Jest + Puppeteer to keep real-browser parity while simplifying setup.
What is the current behavior?
GitHub Issue Number: N/A
What is the new behavior?
What Changed
test/bundler/vite-bundle-test/vite-bundle.spec.ts
dist/, waits for hydration, asserts Shadow DOM text.node:http,node:fs,node:pathfor cross-platform static serving.Browser/Servertypes.test/bundler/jest.config.js
ts-jestconfig for TypeScript specs.test/bundler/* package.json clean scripts
rm -rfwith Nodefs.rmSyncfor Windows/macOS/Linux compatibility.test/bundler/readme.md
Removed Karma files
Root script (package.json)
test.jest.lowmemfor CI/local stability (8GB heap, 50% workers).Parity With Karma
✅ Real Chromium via Puppeteer (not jsdom)
✅ Static serving of Vite output, no dev-server coupling
✅ Shadow DOM assertions after hydration
✅ Cross-platform (Windows/macOS/Linux)
CI/Local Stability
npm run test.jest.lowmem:node --max-old-space-size=8192 --experimental-vm-modules ./node_modules/jest/bin/jest.js --maxWorkers=50%Documentation
Does this introduce a breaking change?
Testing
npm run buildcd test/bundler && npm run startnpm run test.jest.lowmemOther information
Notes: