Skip to content

test(test-runner): migrate integration tests from mocha/chai to node:test#3099

Open
bennypowers wants to merge 3 commits into
masterfrom
migrate/test-runner-integration-node-test
Open

test(test-runner): migrate integration tests from mocha/chai to node:test#3099
bennypowers wants to merge 3 commits into
masterfrom
migrate/test-runner-integration-node-test

Conversation

@bennypowers
Copy link
Copy Markdown
Member

Summary

  • Migrate shared integration/test-runner/ framework (7 test helper files, 567 lines) from mocha/chai to node:test/node:assert/strict
  • Migrate test-runner-chrome, test-runner-playwright, test-runner-puppeteer test wrappers
  • All four must migrate together since the wrappers import from the shared framework

Changes per component

integration/test-runner/ (shared framework):

  • chai assertions to node:assert/strict
  • Mocha globals (describe/before/it) to explicit node:test imports
  • __dirname to import.meta.dirname
  • Internal .js imports to .ts for strip-types compatibility
  • Test script: mocha to node --experimental-strip-types --test

test-runner-chrome/playwright/puppeteer (wrappers):

  • this.timeout(N) to describe('...', { timeout: N }, () => ...)
  • ../src/index.js to ../dist/index.js
  • Integration import uses .ts extension
  • Test scripts: mocha to node --experimental-strip-types --test

No published code changes

All packages' src/ directories are untouched. Only test files and test scripts changed.

Test plan

  • test-runner-chrome: 22/22 pass locally
  • test-runner-puppeteer: 22/22 pass locally
  • test-runner-playwright chromium: pass locally
  • test-runner-playwright firefox: pass locally
  • test-runner-playwright webkit: known local failure (missing system libs), passes in CI
  • CI green

…test

Migrate the shared integration test framework and all three browser
launcher test wrappers (chrome, playwright, puppeteer) from mocha/chai
to node:test/node:assert/strict.

Changes:
- integration/test-runner: chai assertions to node:assert, mocha
  globals to node:test imports, `__dirname` to `import.meta.dirname`,
  internal imports use .ts extension for strip-types
- test-runner-chrome: this.timeout to describe options, src -> dist
  imports, integration import uses .ts extension
- test-runner-playwright: same as chrome
- test-runner-puppeteer: same as chrome
- All test scripts: mocha -> node --experimental-strip-types --test

No published code changes. All packages' src/ directories are untouched.

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

⚠️ No Changeset found

Latest commit: c94513b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant