📝 Docs: Should let people know test file execution order can be controlled by import/require #4925
Labels
area: documentation
anything involving docs or mochajs.org
status: wontfix
typically a feature which won't be added, or a "bug" which is actually intended behavior
type: feature
enhancement proposal
The docs mention a number of ways that test file execution order can be controlled, but there is no mention of the most semantically powerful way: by importing or requiring
testA.js
intestB.js
,testA.js
will execute first.This is incredibly powerful, as one is able to express that if both
testA.js
andtestB.js
tests fail, the failures should be examined intestA.js
first, either because there is a dependency (e.g.testB.js
depends on things tested bytestA.js
) or becausetestA.js
tests something more fundamental.See How to set execution order of mocha test cases in multiple files, in particular this answer.
The text was updated successfully, but these errors were encountered: