mhevery/jasmine-node — pull request #328 by AndyWalker-AMZN (2014-07-02 17:31:20+00:00)
Title: Add ability to run spec files in random order

Because jasmine-node doesn't spin up a separate Node process for each spec file, it's possible for global state to get polluted in such a way that specs pass or fail depending on the order in which they're run.

For instance, a spec may accidentally omit the creation of some global config which is required for its class under test - but the spec might still run because a previous spec created the config. Obviously, the best way to deal with this is simply never to use global config, but that's not always practical.

One way to sniff out inadvertent order dependencies is to run spec files in a random order - similar to rspec's `--order rand` flag.

I wrote a relatively quick-and-dirty test order randomizer (attached to pull request) for my team's use, which has already succeeded in finding some inter-spec dependencies in our large set of Jasmine specs.

This adds the following options:
--randomize, which shuffles the list of spec files and
prints out the seed it used to initialize the RNG
--seed SEED, which seeds the RNG to replay an earlier
shuffled test run

Is this something that the jasmine-node project would be interested in?