基于本教程使用 chai 测试 angularjs 应用程序,我想使用“应该”样式添加一个未定义值的测试。这失败了:
it ('cannot play outside the board', function() {
scope.play(10).should.be.undefined;
});
出现错误“TypeError: Cannot read property 'should' of undefined”,但测试以“expect”样式通过:
it ('cannot play outside the board', function() {
chai.expect(scope.play(10)).to.be.undefined;
});
我怎样才能让它与“应该”一起工作?