dimanche 29 novembre 2015

Last assert not thrown when testing Node.js

I was doubting all of my tests were being run so I set this up to intentionally fail. It looks like if the assert is false it simply is not evaluated. I have looked around without much luck. Has anyone seen this before?

messages.route_message(testData.message_json, function(err, result) {
            console.log("done");
            assert(stubbedDao.get_reg_id.called);
            console.log("done");
            assert(stubbedGcm.send_message.calledOnce);
            console.log("done");
            assert(false);
            console.log("done");
        });

Logs (stdout):

done done done

I get the same results if I try a statement that I know is false. Such as stubbedGcm.send_message.calledTwice (which would contradict the preceding assert)

any ideas?

Aucun commentaire:

Enregistrer un commentaire