So, I have code in before()that runs before any tests. Is there a way in the function to stop the mocha from running any tests?
before()
before(function() { if(someCondition === true) { //kill mocha before it executes any tests } });
Is this possible?
You can call the callback donewith an error:
done
before(function(done) { if(someCondition === true) { return done('Error'); } });
Source: https://habr.com/ru/post/1545488/More articles:WebRequest and HttpServletRequest in Spring MVC - javaHow to partition NSArray in sections of a UITableView in alphabetical order - iosSort NSArray from NSDiction using comparator - iosFire ul tag click event not li with jquery - javascriptHow to round a byte to 0 or 255 using shift operators - c #getIntent () in onResume () always returns the same action, how to use it? - androidView Controller does not load view storyboard - iosWindows Application Database: "Unhandled exception of type" System.ArgumentException "occurred in System.Data.dll" - c #Saving javafx.scene.canvas with transparent pixels - javaJava nashorn compares if java objects have a specific java type - javaAll Articles