test(node-suite): expand node:test parity coverage#6455
Open
TheHypnoo wants to merge 3 commits into
Open
Conversation
📝 WalkthroughWalkthroughChangesNode test parity
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/node_suite_run.py`:
- Around line 51-66: Update normalize and the _TEST_LOCATION pattern to accept
optional leading whitespace before test-location lines and “ℹ duration_ms”
diagnostics, while preserving the existing canonical replacements and
indentation handling for nested suites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1732e523-90bf-49d9-9fa3-c4dc3e7fa39a
📒 Files selected for processing (35)
scripts/node_suite_run.pytest-parity/node-suite/test/README.mdtest-parity/node-suite/test/mock-fn/accessor-options.tstest-parity/node-suite/test/mock-fn/call-record-errors.tstest-parity/node-suite/test/mock-fn/implementations.tstest-parity/node-suite/test/mock-fn/method-restore-chain.tstest-parity/node-suite/test/mock-fn/property-context.tstest-parity/node-suite/test/mock-fn/times-options.tstest-parity/node-suite/test/mock-fn/tracker-reset-restore.tstest-parity/node-suite/test/mock-fn/validation.tstest-parity/node-suite/test/mock-timers/date-set-time.tstest-parity/node-suite/test/mock-timers/run-all-nested.tstest-parity/node-suite/test/mock-timers/tick-boundary-order.tstest-parity/node-suite/test/runner/api/run-empty.tstest-parity/node-suite/test/runner/context/assertions.tstest-parity/node-suite/test/runner/context/failure-propagation.tstest-parity/node-suite/test/runner/context/metadata-values.tstest-parity/node-suite/test/runner/context/only-registration.tstest-parity/node-suite/test/runner/context/plan-match.tstest-parity/node-suite/test/runner/context/plan-mismatch.tstest-parity/node-suite/test/runner/context/plan-overrun.tstest-parity/node-suite/test/runner/context/plan-zero.tstest-parity/node-suite/test/runner/context/runtime-directives.tstest-parity/node-suite/test/runner/hooks/after-each-after-throw.tstest-parity/node-suite/test/runner/hooks/before-throw-cleanup.tstest-parity/node-suite/test/runner/hooks/cleanup-after-throw.tstest-parity/node-suite/test/runner/hooks/nested-before-each-throw.tstest-parity/node-suite/test/runner/hooks/nested-suites.tstest-parity/node-suite/test/runner/hooks/runtime-skip-after-each.tstest-parity/node-suite/test/runner/hooks/top-level-order.tstest-parity/node-suite/test/runner/registration/nested-subtests.tstest-parity/node-suite/test/runner/registration/parent-child-completion.tstest-parity/node-suite/test/runner/registration/suite-nesting.tstest-parity/node-suite/test/runner/registration/top-level-order.tstest-parity/node_suite_baseline.json
…-parity # Conflicts: # test-parity/node_suite_baseline.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
node:testfixtures, growing the suite from 11 to 90 casesnode:testfloor from 7/11 to 33/90 and record the clean full-suite result of 2772/2949Upstream evidence
Selection was compared against current primary repository snapshots:
34c28d5a69f4f00cd599adcbe57834435d3a683b: test-runner registration, context, hooks, mocking, mock timers, reporters, plans, and snapshotsf8a17c8171569fa2870d740030aaa59c91fdf9ee:ext/node/polyfills/testing.ts6173d6431ee8ad086bf79d1d5354080cfe937964:test/js/node/test_runnercompatibility selection and fixturesStable diagnostics
The focused result is stable at 33/90. The 57 remaining diffs diagnose:
Passing coverage now includes async and callback registration, assertion/context surfaces, multiple hook ordering, inherited/symbol/accessor/property mocks, call records and restoration, deterministic Date/timeout/interval behavior, snapshot validation, and canonicalized nested reporter output.
Verification
cargo build --profile perry-dev -p perry -p perry-runtime-static -p perry-stdlib-static— passed for the initial branch revision; the follow-up changes only fixtures, documentation, baseline data, and the Python harnessNODE_BIN="$HOME/.nvm/versions/node/v26.5.0/bin/node" PERRY_RUNTIME_DIR="/Users/sergigonzalez/.codex/worktrees/8d98/perry/target/perry-dev" python3 scripts/node_suite_run.py "/Users/sergigonzalez/.codex/worktrees/8d98/perry/target/perry-dev/perry" "$PWD" test— repeated clean result: 33/90, 57 diagnostic diffstestmodule filter — clean full result: 2772/2949 (94.0%)git diff --cached --check/git diff --check— passedcargo fmt --all -- --check— passed./scripts/check_file_size.sh— passedThe full run retained unrelated existing/environment-sensitive deficits; their module floors were not lowered.
Exclusions
CLI discovery, watch mode, coverage, source maps, isolation, global setup, worker IDs, concurrency, randomization, abort/timeout scheduling, refed handles, TTY/color formatting, module mocking, and snapshot update/CLI behavior remain separate runtime or CLI work. Unclaimed TestContext APIs (
waitFor,runOnly, tags, full names, signals, and custom assertions) are not counted as Perry coverage. Constructor-target mocks remain deferred because Perry's wrappers are not constructable. Re-enabling an already enabled mock-timer context remains excluded because Perry leaves a live handle after the validation error.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests