Inspired by this tutorial on testing an AngularJS app with Chai, I am trying to add a test for an undefined value using the "should" style. However, I encountered a failure when attempting this:
it ('cannot play outside the board', function() {
scope.play(10).should.be.undefined;
});
The error message received was "TypeError: Cannot read property 'should' of undefined", but surprisingly, the test passed when using the "expect" style instead:
it ('cannot play outside the board', function() {
chai.expect(scope.play(10)).to.be.undefined;
});
Can anyone advise on how to make it work with the "should" style?