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

Jest prepend ": " to any Error without message #9988

Closed
bertho-zero opened this issue May 6, 2020 · 2 comments · Fixed by #9990
Closed

Jest prepend ": " to any Error without message #9988

bertho-zero opened this issue May 6, 2020 · 2 comments · Fixed by #9990

Comments

@bertho-zero
Copy link
Contributor

// index.test.js

console.log(new Error());

Result with jest:

Error: 
    at Object.<anonymous> (/home/bertho/oa/packages/verror/test/index.test.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

Result with node:

Error
    at Object.<anonymous> (/home/bertho/oa/packages/verror/test/index.test.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

When there is no message for the error, the behavior of Javascript is to display just the name of the error, Jest adds a colon and a space in all cases.

@thymikee
Copy link
Collaborator

thymikee commented May 6, 2020

Sounds like an opportunity to contribute if you care :)

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants