xolvio / chimp

Tooling that helps you do quality, faster.
MIT License
798 stars 139 forks source link

Stacktrace NOT shown for ``expect().to.be.*`` #382

Closed thebarty closed 8 years ago

thebarty commented 8 years ago

Hi guys,

now this is weird: I am NOT seing a stacktrace when a test fails with to.be, p.e.

it('failing test @watch', () => {
    expect(true).to.be.false
 }

all I am getting is a

Uncaught AssertionError: expected true to be false

Any ideas whats going on?

samhatoum commented 8 years ago

I'm not sure if that's standard mocha behviour or not. We don't do anything funky with it

pscheit commented 8 years ago

At least in cucumber I have the same problem. I think you're doing something fancy with it: https://github.com/xolvio/chimp/blob/master/dist/lib/cucumberjs/cucumber.js#L219

It's only added if the basePath is found in the line of the backtrace. But in cucumber the path seems already to be cleaned up from absolute paths

thebarty commented 8 years ago

just stumbled upon this again... with complex tests this is a pain in the ass cause you end up writing console.logs() for debugging...

samhatoum commented 8 years ago

are you using cucumber? do you have some reproducible steps I could use?

pscheit commented 8 years ago

should fail with any step. Yes cucumber. Just write a cucumber step that has an exception?

samhatoum commented 8 years ago

The output conditioning has been fixed to show the right step failures, and you can now also set a conditionOutput option to false if you want the direct cucumber.js output

from v0.37.1

thebarty commented 7 years ago

Hi guys,

sorry for coming back so late. I stumbled upon this beast again and found a good reference - it seems to be a mocha problem: https://github.com/chaijs/chai/issues/425.

It seems like a workaround might be to pass --full-trace option to mocha. Can you guys add this option to https://github.com/xolvio/chimp/blob/master/src/bin/default.js#L98??

In my setup I run chimp like this

chimp ./tests/_circle-ci-chimp-config.js --ddp=http://localhost:3000 --path=tests --mocha
thebarty commented 7 years ago

Yeah I guess it is better to go on with this topic in the "configure mocha"-topic. Thanks for the quick response