Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running mochawesome from root can mangle testsuite file property #394

Open
gofr opened this issue May 29, 2023 · 0 comments
Open

Running mochawesome from root can mangle testsuite file property #394

gofr opened this issue May 29, 2023 · 0 comments

Comments

@gofr
Copy link

gofr commented May 29, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant