perf: Fix worker test execution excessive delay#453
Conversation
nev21
commented
Feb 24, 2026
- add shared worrker adapter/runner
- switch worker Karma to mocha + karma-typescript and update globs
- drop unused karma-* deps and refresh rush shrinkwrap
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #453 +/- ##
==========================================
- Coverage 99.03% 97.56% -1.47%
==========================================
Files 19 27 +8
Lines 727 1439 +712
Branches 183 339 +156
==========================================
+ Hits 720 1404 +684
- Misses 7 35 +28 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR optimizes worker test execution performance by replacing the slow karma-mocha-webworker + rollup setup with a faster karma-typescript-based approach using custom worker adapter and runner scripts.
Changes:
- Switched worker tests from karma-mocha-webworker + rollup preprocessor to mocha + karma-typescript with custom worker adapter/runner
- Added environment-specific test files to validate test execution contexts (browser, node, worker)
- Removed unnecessary dependencies (karma-coverage, karma-coverage-istanbul-reporter, karma-mocha-webworker, karma-rollup-preprocessor) and removed NODE_OPTIONS memory limit workaround
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/test/src/worker/isWorker.test.ts | New test to validate worker environment detection |
| lib/test/src/node/isNode.test.ts | New test to validate Node environment detection |
| lib/test/src/browser/isBrowser.test.ts | New test to validate browser environment detection |
| lib/package.json | Updated test scripts with proper glob patterns and removed unused karma dependencies |
| lib/karma.worker.conf.js | Completely refactored to use karma-typescript instead of rollup for faster compilation |
| lib/karma.debug.worker.conf.js | Refactored debug configuration with karma-typescript and updated browser launcher settings |
| lib/karma.browser.conf.js | Updated file glob to exclude worker and node tests |
| common/test/worker-adapter.js | New adapter that runs in main page context to coordinate worker test execution |
| common/test/worker-test-runner.js | New runner that executes tests inside Web Worker context |
| common/config/rush/npm-shrinkwrap.json | Updated lockfile reflecting dependency changes and version updates |
| .gitignore | Removed browser/ directory entry (no longer generated) |
Files not reviewed (1)
- common/config/rush/npm-shrinkwrap.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- add shared worrker adapter/runner - switch worker Karma to mocha + karma-typescript and update globs - drop unused karma-* deps and refresh rush shrinkwrap
606bd7a to
f99a960
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- common/config/rush/npm-shrinkwrap.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nevware21-bot
left a comment
There was a problem hiding this comment.
Approved by nevware21-bot