`node:test` Tests without callback should not be reported as ok
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- testing-qa
Research direction
Start by reproducing the issue with the provided node:test describe/it example on Node.js 26.7.0, then trace how tests without callbacks are classified in the node:test implementation and its tests. Done means an empty test is no longer reported as pass and is classified consistently with the expected todo behavior, with existing test reporting preserved.
Written by the indexing model from the issue text.
Description
Version
26.7.0
Platform
Subsystem
No response
What steps will reproduce the bug?
describe('two todos', () => {
// TODO
it('should handle first case', (t) => {
t.todo();
});
// TODO
it('should handle second case');
});
This would report as
ℹ tests 2
ℹ suites 1
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 1
How often does it reproduce? Is there a required condition?
Deterministic
What is the expected behavior? Why is that the expected behavior?
A test with no body, thus that doesn't test anything, should not be reported as OK.
It usually indicates a test that's TODO, so the existing feature of reporting todos may be the most relevant option there, and I think (?) it would be non-breaking for existing test suites.
What do you see instead?
TODO/incomplete test reported as pass
Additional information
Hi there 👋
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.4k
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 279
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/node
-
doc
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
build
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100