angular-test-patterns icon indicating copy to clipboard operation
angular-test-patterns copied to clipboard

Mocha: expected [Function: wrapper] to throw an error

Open deedubbleyoo opened this issue 10 years ago • 3 comments

Hi,

When running the service test template through Karma, the error test fails, as it is not throwing an error.

I happen to be using Mocha (and have converted the matcher to:

expect(wrapper).to.throw('mySvc:  not provided');

Do you have any insight why the test might be failing?

deedubbleyoo avatar Apr 04 '14 09:04 deedubbleyoo

That test pattern was added about a month ago SHA https://github.com/daniellmb/angular-test-patterns/commit/6562aa45bdf200fe4275347e9199ddf4a4c5b979#diff-3a53f5c03b03e7657006c210bf3d2149 I just ran through the Prepare your environment steps on a fresh clone of the repo and npm test ran without any errors. But that's using Jasmine, I would absolutely love to have AngularJS test patterns for Mocha/Chai but I need to stay focused on adding to the existing patterns before taking that on.

daniellmb avatar Apr 05 '14 14:04 daniellmb

I totally understand. We've found your test patterns immensely helpful with our project so please accept our thanks!

If I manage to work out what's going on (and assuming it's mocha related) I'll happily submit a PR with our mocha versions for you.

deedubbleyoo avatar Apr 05 '14 20:04 deedubbleyoo

Sounds great, I'd be interested in what you find. I have a lot more patterns in the works to add, just not time to do it ;-)

daniellmb avatar Apr 05 '14 22:04 daniellmb