Skip to content

Initial Karma to Web Test Runner migration#1289

Merged
matux merged 10 commits into
matux/wtrfrom
matux/karma-to-wtr
Aug 27, 2025
Merged

Initial Karma to Web Test Runner migration#1289
matux merged 10 commits into
matux/wtrfrom
matux/karma-to-wtr

Conversation

@matux

@matux matux commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Caution

This PR is being merged into a feature branch: matux/wtr.

CI is going to fail due to a fundamental incompatibility with Karma in the migration process (details below).

Description of the change

Migrates 296 of ~350 browser tests from deprecated Karma to modern Web Test Runner.

Note

Tests now run in 0.3s vs 24.3s (81x faster)!

Target branch: matux/wtr (feature branch, not master)
Breaking change: Karma tests temporarily disabled due to Chai v5 upgrade

Changes

  • Migrated 27 test files to ES modules with Chai v5
  • Added Web Test Runner configuration
  • Created npm scripts: test:wtr and test:wtr:watch
  • Upgraded Chai v4 → v5 (ESM-only, breaks Karma compatibility)

Blocked Tests (16% remaining)

  • 3 files blocked by error-stack-parser and uncaught error issues
  • 4 files hang (async/timer issues)
  • 4 example tests (need special handling)

Testing

npm run test:wtr

Related issues

SDK-493/replace-karma-with-webtest-runner-for-modern-performant-browser

@matux matux self-assigned this Aug 8, 2025
@matux matux force-pushed the matux/karma-to-wtr branch 2 times, most recently from 66b7be7 to 3636c23 Compare August 26, 2025 18:54
@matux matux force-pushed the matux/karma-to-wtr branch from 3636c23 to d7add33 Compare August 27, 2025 16:11
@matux matux changed the base branch from master to matux/wtr August 27, 2025 16:12
@matux matux changed the title (Draft) Karma to Web Test Runner migration Initial Karma to Web Test Runner migration Aug 27, 2025
@matux matux requested a review from Copilot August 27, 2025 16:40
@matux matux marked this pull request as ready for review August 27, 2025 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the project from Karma test runner to Web Test Runner, a modern alternative for running browser tests. The migration includes configuration setup, dependency updates, and test file modifications to work with the new test runner environment.

  • Updates test configuration with Web Test Runner setup and selective test exclusions
  • Migrates test files from globals-based imports to ES6 module imports
  • Updates Chai assertion syntax from function calls to property access

Reviewed Changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 2 comments.

File Description
web-test-runner.config.mjs New configuration file for Web Test Runner with browser setup and test exclusions
package.json Adds Web Test Runner dependencies and updates Chai version
test/**/*.test.js Updates all test files to use ES6 imports and modern Chai syntax

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test/utility.test.js Outdated
Comment thread package.json
"babel-loader": "^9.2.1",
"bluebird": "^3.3.5",
"chai": "^4.2.0",
"chai": "^5.3.3",

Copilot AI Aug 27, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Chai version has been upgraded from 4.x to 5.x which introduces breaking changes. This is a major version bump that may affect assertion behavior and should be thoroughly tested to ensure compatibility with existing test assertions.

Suggested change
"chai": "^5.3.3",
"chai": "^4.3.7",

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being thoroughly tested and the breaking changes are the reason why we're merging into a feature branch instead of master.

@matux matux merged commit d317099 into matux/wtr Aug 27, 2025
@matux matux deleted the matux/karma-to-wtr branch August 27, 2025 21:35
matux added a commit that referenced this pull request Sep 8, 2025
* Initial Karma to Web Test Runner migration (#1289)
* Fix hanging tests and expand WTR migration (#1295)
* Migrate example tests for Web Test Runner (#1298)
* Migrate browser transform and core tests for Web Test Runner  (#1299)
* Migrate browser tests from Karma to Web Test Runner (#1300)
* Initial migration of react native tests (#1301)
* Remove Grunt and Karma (#1302)
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.

3 participants