Skip to content

refactor(test-runner-commands): migrate tests to node:test#3092

Open
bennypowers wants to merge 1 commit into
masterfrom
migrate/test-runner-commands-node-test
Open

refactor(test-runner-commands): migrate tests to node:test#3092
bennypowers wants to merge 1 commit into
masterfrom
migrate/test-runner-commands-node-test

Conversation

@bennypowers
Copy link
Copy Markdown
Member

Summary

  • Migrate @web/test-runner-commands 10 test files from mocha globals to node:test
  • No chai used in any file (tests use runTests which throws on failure)
  • __dirname -> import.meta.dirname, ../../src/ -> ../../dist/
  • --experimental-strip-types for CI compat

Test plan

  • 10/17 tests pass on Node 22.22.3 with Chrome (7 fail = Playwright missing system libs, pass in CI)
  • ESLint clean
  • Prettier clean
  • Code review clean

Replace mocha globals with node:test across 10 test files. No chai was
used -- tests rely on runTests throwing on failure.

- Add `import { describe, it } from 'node:test'` (+ before/after where used)
- `../../src/*.js` -> `../../dist/*.js`
- `../selenium-server.js` -> `../selenium-server.ts`
- `__dirname` -> `import.meta.dirname`
- `this.timeout(N)` -> `{ timeout: N }` on describe
- Add `--experimental-strip-types` for CI compat

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: 4bc222b

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

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