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

crash when a mocha test fails with an error that has a circular data structure #5

Open
jandockx opened this issue Jun 1, 2019 · 2 comments

Comments

@jandockx
Copy link

jandockx commented Jun 1, 2019

     >>> logs: Error: TypeError: Converting circular structure to JSON
     >>> logs:     at JSON.stringify (<anonymous>)
     >>> logs:     at makeSimple (node_modules/format-error/index.js:36:28)
     >>> logs:     at format (node_modules/format-error/index.js:39:21)
     >>> logs:     at Runner.<anonymous> (node_modules/mocha-reporter/index.js:283:18)

in runner.on('fail'…, the test.err is formatted with 'format-error'

'format-error' has a known problem with circular data structures since 2014 (
#2) which will not be fixed.

The author:

I think that this module shouldn't really exist. I'd rather fix this in prettyjson itself,

@jandockx
Copy link
Author

jandockx commented Jun 1, 2019

maybe util.inspect would be a sensible replacement?

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

2 participants