teddyzeenny / ember-mocha-adapter

A mocha adapter for ember-testing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

andThen / then issue after visit

toovy opened this issue · comments

Hi teddyzeenny,

thanks for creating this adapter, should be useful to many people who dislike QUnit.

Nevertheless I've encountered a strange behavior which I cannot fix myself as I'm not deep enough into mocha testing and your adapter.

I've created a fiddle http://jsfiddle.net/UD2D3/ which can be used to reproduce the problem.

Note that all tests titled "should fail" are expected to fail. If the visit helper is used in the beforeEach hook everything works as expected. But if the visit helper is used in the test function combined with andThen/then the failed tests look like they were executed successfully. In reality the tests fail, but the error is only reported in the console instead of the mocha UI.

This bug might be related to issue #6 .

Thanks for your advice.

Best regards,
toovy

mocha.setup 'bdd' removes the purpose of the adapter.

What the adapter does is define a new UI called ember-bdd. So just remove the line mocha.setup 'bdd' and everything should work.

http://jsfiddle.net/UD2D3/1/

Thanks!