The most common use case where this is going to be very important is when you have a situation where you need to control order of requirements across multiple tests files.
In this scenario you would simply want a spec_helper.js file that would have all of your require_relative() directives in it, in the correct order. Plus you could have any other setup js in the spec_helper.js.
Then your actual spec files would only have to require_relative the spec_helper.js and all the order issues could be controlled in a singular place. This very much follows the rspec model.
The most common use case where this is going to be very important is when you have a situation where you need to control order of requirements across multiple tests files.
In this scenario you would simply want a
spec_helper.js
file that would have all of your require_relative() directives in it, in the correct order. Plus you could have any other setup js in thespec_helper.js
.Then your actual spec files would only have to require_relative the
spec_helper.js
and all the order issues could be controlled in a singular place. This very much follows the rspec model.