Building on this tutorial testing an angularjs app with chai, I want to add a test for an undefined value using the "should" style. This fails:
it ('cannot play outside the board', function() {
scope.play(10).should.be.undefined;
});
with error "TypeError: Cannot read property 'should' of undefined", but the test passes with the "expect" style:
it ('cannot play outside the board', function() {
chai.expect(scope.play(10)).to.be.undefined;
});
How can I get it working with "should"?
assert.isUndefined(scope.play(10))
– lukaserat