Skip to content

chore: switch test runner to jsdom#276

Merged
DylanPiercey merged 1 commit into
mainfrom
switch-to-jsdom
Jun 11, 2026
Merged

chore: switch test runner to jsdom#276
DylanPiercey merged 1 commit into
mainfrom
switch-to-jsdom

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

Switches the test runner from playwright to jsdom.

Usually you'd do the opposite but doing so here gives us:

  • deterministic runs (playwright was kinda flakey)
  • much faster runs
  • much much faster runs in ci since there's no playwright install

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8d37426

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

@DylanPiercey DylanPiercey merged commit 451fdfa into main Jun 11, 2026
7 checks passed
@DylanPiercey DylanPiercey deleted the switch-to-jsdom branch June 11, 2026 18:50
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea78c347-e676-4eb9-b271-3b76dbe99f73

📥 Commits

Reviewing files that changed from the base of the PR and between 1b8fbec and 8d37426.

⛔ Files ignored due to path filters (36)
  • package-lock.json is excluded by !**/package-lock.json and included by **
  • src/__tests__/fixtures/browser-basic/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-basic/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-marko-dep/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-marko-dep/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-marko-shorthand-import/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-marko-shorthand-import/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-base-url/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-base-url/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-basic-hmr/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-basic-hmr/__snapshots__/dev-hmr.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-basic-hmr/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-basic/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-basic/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-bundle-splitting/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-bundle-splitting/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-circular-entry-file/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-circular-entry-file/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-commonjs/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-commonjs/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-glob-import/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-glob-import/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-marko-dep/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-marko-dep/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-modulepreload/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-modulepreload/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-relative-asset-import/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-relative-asset-import/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-runtime-base-path/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-runtime-base-path/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-server-only-hmr/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-server-only-hmr/__snapshots__/dev-hmr.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-server-only-hmr/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-tags-api-basic/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-tags-api-basic/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/isomorphic-virtual-file-hmr/__snapshots__/dev-hmr.expected.md is excluded by !**/__snapshots__/** and included by **
📒 Files selected for processing (25)
  • .github/workflows/ci.yml
  • .mocharc.json
  • package.json
  • src/__tests__/fixtures/browser-basic/test.config.ts
  • src/__tests__/fixtures/browser-marko-dep/test.config.ts
  • src/__tests__/fixtures/browser-marko-shorthand-import/test.config.ts
  • src/__tests__/fixtures/isomorphic-base-url/test.config.ts
  • src/__tests__/fixtures/isomorphic-basic-hmr/test.config.ts
  • src/__tests__/fixtures/isomorphic-basic/test.config.ts
  • src/__tests__/fixtures/isomorphic-bundle-splitting/test.config.ts
  • src/__tests__/fixtures/isomorphic-circular-entry-file/src/template.marko
  • src/__tests__/fixtures/isomorphic-circular-entry-file/test.config.ts
  • src/__tests__/fixtures/isomorphic-commonjs/test.config.ts
  • src/__tests__/fixtures/isomorphic-glob-import/test.config.ts
  • src/__tests__/fixtures/isomorphic-marko-dep/test.config.ts
  • src/__tests__/fixtures/isomorphic-modulepreload/test.config.ts
  • src/__tests__/fixtures/isomorphic-relative-asset-import/test.config.ts
  • src/__tests__/fixtures/isomorphic-runtime-base-path/test.config.ts
  • src/__tests__/fixtures/isomorphic-server-only-hmr/test.config.ts
  • src/__tests__/fixtures/isomorphic-tags-api-basic/test.config.ts
  • src/__tests__/fixtures/isomorphic-tags-api-virtual-file-hmr/src/tags/child-tag.marko
  • src/__tests__/fixtures/isomorphic-virtual-file-hmr/src/components/class-component.marko
  • src/__tests__/fixtures/isomorphic-virtual-file-hmr/test.config.ts
  • src/__tests__/main.test.ts
  • src/__tests__/utils/create-browser.ts

Walkthrough

This PR replaces Playwright-based browser automation with a JSDOM-backed Browser abstraction and a new fromURL() harness that streams and evaluates HTML/modules. The main test harness is refactored to use ephemeral server ports, browser-side HMR tracking (window.__nextHmr and reloadCount), and Browser.drain/settle flows. Fixtures are migrated from async Playwright page APIs to synchronous browser.window.document DOM interactions. CI and dev dependencies remove Playwright, bump jsdom, and enable Mocha VM modules.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: switch test runner to jsdom' directly and accurately summarizes the main change: migrating the test infrastructure from Playwright to jsdom.
Description check ✅ Passed The description explains the motivation for switching from Playwright to jsdom and lists concrete benefits (deterministic runs, faster local execution, faster CI).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch switch-to-jsdom

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


Comment @coderabbitai help to get the list of available commands and usage tips.

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