Testing framework: mocha
I want to test saving and then deleting created document in mongodb (with mongoose)
Code that actually do this :
item = new Item()
item.save(function(err, data){
// if no errors test passed, then I need to test removing that item
Item.remove({_id: data.id})
})
How should I describe the test?
I want to have separate tests results for save and remove in output.
Thanks.
1 Answer