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

Stack traces on to.be.true/false #358

Closed
pschuegr opened this issue Feb 3, 2015 · 6 comments · Fixed by gluckgames/pixi-packer#15
Closed

Stack traces on to.be.true/false #358

pschuegr opened this issue Feb 3, 2015 · 6 comments · Fixed by gluckgames/pixi-packer#15

Comments

@pschuegr
Copy link

pschuegr commented Feb 3, 2015

Apologies if this is covered somewhere but I've had no luck with finding any information.

expect(var).to.equal(true)

throws an error with a full call stack including the location of the statement, but

expect(var).to.be.true

throws an error where the call stack is all inside chai code. Is there something that can be done about this, or do I just need to use the first form?

@keithamus
Copy link
Member

@pschuegr thanks for the issue.

This kind of looks like a dupe of #355. Could you have a look at #355 and see if this issue is the same? If it is then I recommend we close this one and work on #355, otherwise, if you could provide more information about this issue, and why it is different to #355, that'd be just swell 😄

@rileyjshaw
Copy link

@keithamus a good test case is written up here.

I'm coming up against the same problem and I'm looking for a way to suppress the stack trace on .to.equal() calls. As the link mentions, chai.config.includeStack = false doesn't help.

Any suggestions? These stack traces are making it really hard to quickly parse the reporter's output...

@rileyjshaw
Copy link

(And as far as I can tell, this is not a dupe of #355)

@keithamus
Copy link
Member

@rileyjshaw The reduced test case in the stackoverflow link you posted helps clarify things a lot.

Having said that, I'm not entirely sure what's going on here. I welcome a PR to fix it but can't offer any insight into why its happening.

I'll mark it as hard, because I'm quite sure it's going to be hard to track down the behaviour. But a PR is welcomed! As always, PRs grant you a place on the hall of fame. If either of you are going to attempt a PR, I'd recommend announcing so here - so you don't both spend time working on it!

kpdecker added a commit to kpdecker/chai that referenced this issue Sep 8, 2015
The ssfi parameter was not being updated for these methods, which ended up causing the trace to be omitted.

Fixes chaijs#358
@kpdecker
Copy link
Contributor

kpdecker commented Sep 8, 2015

This should be fixed under #514.

@kpdecker
Copy link
Contributor

kpdecker commented Sep 8, 2015

Also seems like #425 echos a lot of the concerns here, perhaps a dupe.

lucasfcosta pushed a commit to lucasfcosta/chai that referenced this issue Mar 14, 2016
The ssfi parameter was not being updated for these methods, which ended up causing the trace to be omitted.

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

Successfully merging a pull request may close this issue.

4 participants