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

"[object Object]" is printed instead of runtime errors #41

Open
prantlf opened this issue May 20, 2018 · 0 comments · May be fixed by #39
Open

"[object Object]" is printed instead of runtime errors #41

prantlf opened this issue May 20, 2018 · 0 comments · May be fixed by #39

Comments

@prantlf
Copy link

prantlf commented May 20, 2018

If the tests fail with a severe error , like requiring a non-existing script, or by a syntax error in a script, the error is not printed correctly. It is an object and after applying toString to it, even the cat cannot improve the useless output ;-)

HeadlessChrome 0.0.0 (Linux 0.0.0)
[object Object]

For example, if JSON.stringify were applied to it to get the full object printed, it would look like this:

HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
{
  "message": "Uncaught Error: 'expect' was used when there was no current spec,...",
  "str": "Uncaught Error: 'expect' was used when there was no current spec, ..."
}

As long as the object structure is known, if object.message is defined, the message can be printed right away:

HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
Error: 'expect' was used when there was no current spec,...
@prantlf prantlf linked a pull request May 20, 2018 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant