In the second file, require the first one: --- two.js --- require("./one"). Mocha will run the tests in the order the describe calls execute.
I follow a totally seperate solution for this. Put all your tests in a folder named test/ and Create a file tests.js in the root directory in the order of ...
In asynchronous tests, the same ordering applies. Test Foo should run before Bar even Foo takes much longer to execute, and Suite B should ...
(I also have regular, order agnostic test files run through mocha). Mocha would be perfect for it, if I could control test execution order somehow.
Running tests in parallel mode allows Mocha to take advantage of
This can then cause problems trying to run single tests or test suites in isolation. By executing files in a random order on each execution of a test suite the risk of ...
file watcher support; global variable leak detection; optionally run tests that
Mocha.js provides functions that execute in a specific order and logs
Execute specs in random order karma-runner/karma#1049
Add more references when needed and Mocha will process them in the defined order. Per Test File Setup. For individual setups that should run ...