Skip to content

describe should not be counted as a single test #46762

Description

@MoLow

when running a simple suite of tests, each suite is counted as a single test instead of counting the individual tests

for example, running

const{ describe, it }=require('node:test');describe('suite',()=>{it('test1',()=>{// ...});it('test2',()=>{// ...});});

results in

TAP version 13
# Subtest: suite
# Subtest: test1
ok 1 - test1
---
duration_ms: 0.146666
...
# Subtest: test2
ok 2 - test2
---
duration_ms: 0.060584
...
1..2
ok 1 - suite
---
duration_ms: 2.048875
...
1..1
# tests 1
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 93.241042

I propose the summary should count 2 passed tests instead of 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions