Skip to content

chore(fast-ssr): convert unit tests from Playwright to Node.js test runner#7320

Merged
janechu merged 3 commits intomainfrom
users/radium-v/use-node-for-fast-ssr-tests
Mar 17, 2026
Merged

chore(fast-ssr): convert unit tests from Playwright to Node.js test runner#7320
janechu merged 3 commits intomainfrom
users/radium-v/use-node-for-fast-ssr-tests

Conversation

@radium-v
Copy link
Collaborator

Pull Request

📖 Description

Converts fast-ssr unit tests from Playwright to Node.js built-in test runner (node:test) and assertion module (node:assert/strict). The majority of tests are pure logic tests with no browser dependencies, so they don't need Playwright.

The single browser-dependent test (fast-style.pw.spec.ts) remains on Playwright and is separated by naming convention (*.pw.spec.ts).

👩‍💻 Reviewer Notes

  • fast-style.spec.ts was renamed to fast-style.pw.spec.ts to distinguish it as a Playwright browser test from the pure Node tests.
  • A cross-platform scripts/run-tests.mjs entry point is used to glob test files and invoke node --test, avoiding shell-specific glob expansion.
  • The throws() calls in request-storage.spec.ts use { message: "..." } instead of a plain string to satisfy node:assert's API.
  • Import order in directives.spec.ts was adjusted so the DOM shim loads before @microsoft/fast-element.

📑 Test Plan

All 191 Node-based tests pass with node run-tests.mjs. The Playwright-based fast-style.pw.spec.ts test continues to run via playwright test.

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

janechu
janechu previously approved these changes Mar 17, 2026
@janechu janechu merged commit 99a38cb into main Mar 17, 2026
12 checks passed
@janechu janechu deleted the users/radium-v/use-node-for-fast-ssr-tests branch March 17, 2026 15:01
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.

2 participants