Skip to content

[Bug]: test.concurrent does not respect testNamePattern #12588

@rix0rrr

Description

@rix0rrr

Version

27.5.1

Steps to reproduce

Code:

// example.test.js
test.concurrent('one', async () => {
    console.log('running test one');
});

test.concurrent('two', async () => {
    console.log('running test two');
});

Commands:

$ npm init -y
$ npm install jest
$ npx jest -t one

Expected behavior

I expect to see only:

running test one

Actual behavior

I see both console.logs printed, while the test report pretends it only ran one test:

  console.log
    running test one

      at bla.test.js:2:13

  console.log
    running test two

      at bla.test.js:6:13

 PASS  ./bla.test.js
  ✓ one (1 ms)
  ○ skipped two

Test Suites: 1 passed, 1 total
Tests:       1 skipped, 1 passed, 2 total
Snapshots:   0 total
Time:        0.292 s, estimated 1 s
Ran all test suites with tests matching "one".

Additional context

No response

Environment

System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 16.4.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.18.1 - /usr/local/bin/npm
  npmPackages:
    jest: ^27.5.1 => 27.5.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions