Skip to content

Running mochawesome from root can mangle testsuite file property #394

@gofr

Description

@gofr

I run tests in a docker container, from the root directory. That means the current working directory is /.

That makes this line potentially nonsensical:

file: suite.file ? suite.file.replace(process.cwd(), '') : '',

That file path isn't necessarily an absolute file path. In my case it just strips the first slash in an already relative path. So a test path like my/relative/path/to/test.js becomes myrelative/path/to/test.js, which doesn't exist.

It should probably only strip the CWD if it's at the start of the file path?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions