node.js - Writing mocha test for nodejs -


i beginner nodejs, need know how write mocha test nodejs variable definitions.

for example,

if had object this,

var objectname = {       filename : '',       filepath : ''  } 

then how can write mocha test variable definition. please me write test code. in advance!

i don't test kind of stuff usually, can make (using chai.expect) :

var obj = {   name:'' };  describe('my object definition', function(){   it('should give me empty name', function(){     expect(obj.name).to.equals('');   }); }); 

Comments

Popular posts from this blog

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -

php - Prepared Statement Inner Join Cannot Pass Parameter by Reference -

c# - Value cannot be null or empty.\r\nParameter name: name -