在本教程中使用chai测试angularjs应用程序时,我想使用"should"样式为未定义的值添加测试.这失败了:
it ('cannot play outside the board', function() {
scope.play(10).should.be.undefined;
});
Run Code Online (Sandbox Code Playgroud)
错误"TypeError:无法读取属性'应该'未定义",但测试通过了"expect"样式:
it ('cannot play outside the board', function() {
chai.expect(scope.play(10)).to.be.undefined;
});
Run Code Online (Sandbox Code Playgroud)
如何让它与"应该"一起工作?