vendredi 20 février 2015

Unit test for node js

I am new to nodejs, and need to write unit test for a node project. I try to learn mocha and there are two questions:




  1. when I write unit test for function A, in A it also use function B, so how can I mock an output for B?




  2. how can I unit test these endpoints in app.js. like app.get, app.put. can someone give me some suggestions or simple examples?




Can someone also give me some advice on writing unit test for nodejs, thanks so much.


Thanks so much everyone.


Aucun commentaire:

Enregistrer un commentaire