Skip to content

Jest can't find tests when path contains brackets #1315

@aalbul

Description

@aalbul

I found this problem when tried to run my project on Jenkins.
Unfortunately, i quickly realised that it cannot find tests.

I tried different combinations and was able to reproduce the problem locally. It's quiet easy. Just re-name project folder from "project" to "project (master)".
First, i though that the reason is "space" but after some debugging i found that path is used first to locate files using "contains" and then, later, regular expression is created from the path specified in "testPathDirs".

Unfortunately, it doesn't escape brackets and it lead's to "no tests found" case.

Here is my config:

{
testPathDirs: ['src/test/javascript']
testRegex: '/unit/.*-spec.(js)$'
verbose: true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions