Restore Node.js test registration in ESM - #1039
Conversation
The fixture swallowed require() errors in ESM, so Node reported passing files without executing their tests. Resolve node:test with createRequire and let registration errors propagate, while retaining Workers' collection path and the existing maintenance-branch test API. Add independent subprocess checks for both package export formats, test and step failures, ignored tests, registration errors, and Workers-like collection. Use public IP literals and await rejects() in the newly exercised actor tests so Node's address validation does not depend on DNS. Partially port the registration fix from fab1c07. When forwarding to main, retain its portable test types and corrected step behavior, merge the subprocess checks with its existing type tests, and keep its equivalent actor fix. Re-run vocab on each maintenance branch, especially 2.3's extra actor tests. Validated mise run check, affected Node/Deno/Bun suites, and a local Workers MemoryKvStore test. Full Node testing passed 23 package suites; init/create/cli still fail because inquirer-toggle lacks ansi-escapes, reproduced independently of the fixture. Independent code reviews used OpenCode (deepseek-flash), Codex (gpt-6-astra), and Claude Code (claude-fable-5-1). Claude Code (claude-opus-5) reviewed the implementation plan. Fixes fedify-dev#1036 Changelog: none Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-opus-5
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe fixture harness now loads ChangesFixture Node registration
WebFinger test stability
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant ProbeProcess
participant FixtureHarness
participant NodeTest
participant TestDefinitions
ProbeProcess->>FixtureHarness: Load fixture and register tests
FixtureHarness->>NodeTest: Register tests in supported Node
NodeTest-->>ProbeProcess: Emit test results and diagnostics
FixtureHarness->>TestDefinitions: Collect definitions in Workers
TestDefinitions-->>ProbeProcess: Expose collected definitions without execution
Merge Risk: ⚪ Minimal · up to The Node registration fix preserves the supported Workers configuration and is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
On
2.0-maintenance,@fedify/fixtureswallows the missingrequire()error in ESM, so Node.js reports passing files without running their tests. This ports thecreateRequire()fix from fab1c07, removes the catch, and keeps Workers on its test-collection path without changing the maintenance branch's test API.Regression tests load the built ESM/CJS exports in separate Node.js processes, so the adapter cannot silently skip its own tests. The newly running actor tests use public IP literals to avoid DNS lookups before mocked fetches, and await
rejects()so failures reach the runner.Affected Node/Deno/Bun suites,
mise run check, and a local Workers smoke test pass. The full Node.js run still has unrelatedansi-escapesdependency failures in@fedify/init,@fedify/create, and@fedify/cli.Fixes #1036.