Skip to content

Node 22 ignores --test-name-pattern #53589

Closed as not planned
Closed as not planned
@ai

Description

@ai

Version

v22.3.0

Platform

Linux savoia 6.9.5-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jun 16 15:47:09 UTC 2024 x86_64 GNU/Linux

Subsystem

test

What steps will reproduce the bug?

one.test.js:

import { equal } from 'node:assert'
import { test } from 'node:test'

test('one', () => {
  equal(1, 1)
})
$ node --test-name-pattern="wehadnosuchtextintest" --test one.test.js

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

To have skipped 1 in the output and one test should not be run

What do you see instead?

$ node --test-name-pattern="wehadnosuchtextintest" --test one.test.js
✔ one (0.66693ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 39.554192

Additional information

Here is a simple project where I found that issue

ai/better-node-test#3

Metadata

Metadata

Assignees

No one assigned

    Labels

    test_runnerIssues and PRs related to the test runner subsystem.wontfixIssues that will not be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions