require('should');
var I=function I(){};
I.valueOf=function(){return 'I'}; //whitout this line,test will ok
console.log('typeof I is '+typeof I);
describe("I",function(){
it("I sould be a function",function(){
I.should.be.a('function');
});
});
//output==>AssertionError: expected 'I' to be a function
//code like this:
require('should'); var I=function I(){}; I.valueOf=function(){return 'I'}; //whitout this line,test will ok console.log('typeof I is '+typeof I); describe("I",function(){ it("I sould be a function",function(){ I.should.be.a('function'); }); });
//output==>AssertionError: expected 'I' to be a function