【发布时间】:2016-05-25 18:01:53
【问题描述】:
我不明白为什么以下测试因错误而失败:
TypeError:(中间值).should.be.type 不是函数
describe('#Option object', function() {
it('returns value as whatever type was passed to the constructor', function() {
var o = function() {
this.getValue = function() {
return new Date();
}
};
var i = new o();
i.getValue().should.be.type('Date');
})
});
我已经阅读了 [大部分] Should.js documentation,但我一定遗漏了一些东西。谁能告诉我我的测试出了什么问题?
【问题讨论】:
标签: should.js