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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

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