Recommend node:test over @fedify/fixture for most packages#780
Conversation
Deno, Node.js, and Bun all support node:test and node:assert/strict natively, so there is no longer a need to use @fedify/fixture's test() wrapper in most packages. Update AGENTS.md, CONTRIBUTING.md, and the create-integration-package skill to reflect this: - Default guidance: use node:test + node:assert/strict directly. - Exception: @fedify/fedify and @fedify/vocab must keep using @fedify/fixture's test() because their Cloudflare Workers harness relies on the testDefinitions registry that fixture populates. - @fedify/fixture helpers (mockDocumentLoader, TestSpanExporter, etc.) remain available for any *.test.ts file regardless of test runner. Assisted-by: Claude Code:claude-sonnet-4-6
📝 WalkthroughWalkthroughThree contributor documentation files update test runner guidance to standardize on Node's ChangesTest Runner Standardization Guidance
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the testing documentation across several files (SKILL.md, AGENTS.md, and CONTRIBUTING.md) to transition the preferred testing framework from @fedify/fixture to the built-in node:test and node:assert/strict modules, which are supported natively by Deno, Node.js, and Bun. It also documents the exception for @fedify/fedify and @fedify/vocab packages, which must continue using @fedify/fixture due to Cloudflare Workers test harness requirements. The reviewer feedback suggests replacing em dashes (—) with alternative punctuation (such as semicolons, colons, or parentheses) in the updated documentation files to improve prose formatting.
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Background
@fedify/fixtureoriginally provided atest()wrapper becauseDeno.test()and Node.js'snode:testwere not compatible. The wrapper let the same tests run across runtimes. Deno and Bun now supportnode:testandnode:assert/strict, so most packages can use those APIs directly.The exception is @fedify/fedify and @fedify/vocab. Those packages register tests in a
testDefinitionsarray, which the Cloudflare Workers harness in packages/fedify/src/cfworkers/ runs later. Plainnode:testcalls don't populate that array, so replacing the fixture wrapper there would drop CF Workers test coverage.Changes
This PR updates three documentation files:
node:testandnode:assert/strictfor most packages, with an explicit exception for @fedify/fedify and @fedify/vocab.@fedify/fixture” to “Writing tests withnode:test” and documents the rule: usenode:testby default, and use@fedify/fixture'stest()only where the CF Workers harness depends ontestDefinitions.node:test. Integration packages don't include the CF Workers harness.The fixture helpers that don't register tests (
mockDocumentLoader,TestSpanExporter,createTestTracerProvider) don't change. They can still be imported from any*.test.tsfile regardless of which runner is used.