I\'m having issues getting Chai\'s expect.to.throw to work in a test for my node.js app. The test keeps failing on the thrown error, but If I wrap the test case
expect.to.throw
As this answer says, you can also just wrap your code in an anonymous function like this:
expect(function(){ model.get('z'); }).to.throw('Property does not exist in model schema.');