nodejs / nodejs/node

`node:test` Tests without callback should not be reported as ok

Open
#65,563 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

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 👋

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

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.

Assessment

Tech stack
javascript, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.