Based on this tutorial on testing angularjs app with chai, I want to add a test for undefined value using the "should" style. This fails:
it ('cannot play outside the board', function() { scope.play(10).should.be.undefined; });
with the error "TypeError: Unable to read the 'should' property from 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 make it work with a must?
javascript angularjs testing chai
thebenedict Oct 06 '13 at 13:02 2013-10-06 13:02
source share