最近在学习Mocha写了个简单的测试,但是就被打败了,assert不能正常工作,代码如下
describe('The code attribute', function(){
it('should limited as 3 bits alphets', function(){
var harbor = Harbor.build({name: 'Xinggang',
code: 'AB', harbor_type: 'SOC'});
harbor.save().then(function(dataVal){
assert.equal(dataVal, null);
},
function(err){
assert.notEqual(dataVal, null);
});
});
});
});
我希望这个测试fail掉,但是控制台显示如下异常, 感觉assert模块没有工作,请帮忙解答
Possibly unhandled AssertionError: {"id":1,"name":"Xinggang","code":"AB","harbor_type":"SOC","updatedAt":"2014-11-17T08:44:01.000Z","createdAt":"2014-11-17T08:44:0 == null