Skip to content

Conversation

@heathdutton
Copy link

The test context passed to subtests was missing the .skip, .todo,
and .only variants on t.test. These were available on the top-level
test function but not on the subtest context.

Move the test function from a class method to an arrow function in
the constructor so that .skip, .todo, and .only properties can
be attached to it.

Fixes: #50665

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jan 2, 2026
@avivkeller
Copy link
Member

Can you please add tests?

The test context passed to subtests was missing the `.skip`, `.todo`,
and `.only` variants on `t.test`. These were available on the top-level
`test` function but not on the subtest context.

Move the test function from a class method to an arrow function in
the constructor so that `.skip`, `.todo`, and `.only` properties can
be attached to it.

Fixes: nodejs#50665
@heathdutton heathdutton force-pushed the test_runner/fix-subtest-skip-only-todo-50665 branch from c87fc54 to f8775f9 Compare January 2, 2026 03:48
@heathdutton
Copy link
Author

Added test file: test/parallel/test-runner-subtest-skip-todo-only.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test runner (--test, node:test) subtest test context lack .skip, .only and .todo functions

3 participants