macOS ◆ xterm-256color ◆ bash 1656 views

Runs BDD unit tests using Mocha, but first randomizes the order of unit tests in each suite.

If the tests fail, the order is saved in the file to be used again on the next run, allowing you to debug the problem. If the tests pass, the file with the saved order is deleted, and the tests will be reshuffled again on next run.

This demo shows running Rocha several times until one configuration shows failing assertion due to state pollution among the unit tests. Then we fix the suite using beforeEach block and rerun the tests again to confirm.