Skip to content

refactor(dev-server): migrate tests to node:test#3087

Open
bennypowers wants to merge 1 commit into
masterfrom
migrate/dev-server-node-test
Open

refactor(dev-server): migrate tests to node:test#3087
bennypowers wants to merge 1 commit into
masterfrom
migrate/dev-server-node-test

Conversation

@bennypowers
Copy link
Copy Markdown
Member

Summary

  • Migrate @web/dev-server integration test from mocha globals to node:test
  • 1 .mjs file, no chai, no TypeScript
  • this.timeout(30000) -> { timeout: 30000 }
  • path.dirname(fileURLToPath(import.meta.url)) -> import.meta.dirname

Test plan

  • 6/6 tests pass on Node 22.22.3 with Chrome
  • ESLint clean
  • Prettier clean
  • Code review clean

Replace mocha globals with node:test imports. No chai was used in this
test file -- assertions use manual `throw new Error(...)`.

- Add `import { describe, it, before, after, beforeEach, afterEach } from 'node:test'`
- `this.timeout(30000)` -> `{ timeout: 30000 }` option on describe
- `function test()` / `function it()` -> arrow functions
- Replace `path.dirname(fileURLToPath(import.meta.url))` with `import.meta.dirname`
- Add `--test-force-exit` to prevent test hangs from open handles

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

changeset-bot Bot commented Jun 1, 2026

⚠️ No Changeset found

Latest commit: d6abf3a

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