Skip to content

Test runner cannot find tests in multiple levels when using ** in tha path #50287

@w3nl

Description

@w3nl

Version

20

Platform

Linux tux 6.5.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 7 01:35:40 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

node --test src/**/*.test.js
Only finds tests in all folders in that level, e.g.
src/a/a.test.js and src/b/b.test.js
It cannot find a level deeper, like src/a/b/c.js

It works with node --test src/ in Node 20
But in Node 21 I receive an error, because it thinks that it can test the file src, but src is a folder.

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

Tests in multiple folder levels and usage of /**/ in the cli

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

That /**/ also find tests in multiple levels.

What do you see instead?

That /**/ just check for test files in a single level

Additional information

No response

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