停止运行摩卡的testing
所以我在before()
中有一些代码在任何testing之前执行。 有没有办法在function上能够阻止摩卡运行任何testing?
before(function() { if(someCondition === true) { //kill mocha before it executes any tests } });
是这样的可能吗?
你可以调用done
callback,出现一个错误:
before(function(done) { if(someCondition === true) { return done('Error'); } });