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

Dumping the actual object to console.log when assertion fails #678

Closed
ghost opened this issue Apr 14, 2016 · 1 comment
Closed

Dumping the actual object to console.log when assertion fails #678

ghost opened this issue Apr 14, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 14, 2016

Hi,

I'm using mocha + chai in the browser. When an assertion fails, mocha displays like this:

AssertionError: expected { Object (0, 1, ...) } to have a length of 1 ...

It would be nice if it dumped the actual object to console.log instead of the string "Object (0, 1, ...)". Is this possible? I've asked a mocha guy about this, but he says it the matter of the assertion library.

@keithamus
Copy link
Member

Hey @aosho235 thanks for the issue.

While the message is our responsibility (and we're working on making it better); diff output is the responsibility of the test runner, and it is missing in the Mocha HTML reporter. See mochajs/mocha#1348 for more.

I'm going to close this as its a duplicate of #469 for us. Feel free to continue the discussion in #469 or mochajs/mocha#1348.

Thanks

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