Simplify Mocha npm scripts (#12313)
The npm scripts used to run Mocha scripts have been greatly simplified. As we transition more tests from Mocha to Jest it was becoming increasingly difficult to update the CLI arguments to keep all of these scripts working correctly. This reorganization should make that process much simpler. The base Mocha options are in `.mocharc.js` - all except for the target tests to run. Those are still given via the CLI. There is a second config file specifically for the `test:unit:lax` tests (i.e. the Mocha tests that have no coverage requirements) because it requires a change to the `ignored` configuration property. We can create an additional configuration file for each test script we add that needs further configuration changes. The `test:unit:path` script used to be used to run Mocha tests at a given path. Now that can be done using `yarn mocha` instead, so this script has been removed. The `yarn watch` command has been broken for some time now, so it has been removed as well. Mocha tests can still be run with a file watcher using `yarn mocha --watch <path>` or `yarn test:unit:mocha --watch`. The README has been updated to remove references about the `watch` command that was removed. I considered explaining the other test scripts there as well, but they were difficult to explain I will attempt to update the README after making further simplifications instead.feature/default_network_editable
parent
b07354af52
commit
e4cf12674e
@ -0,0 +1,7 @@ |
||||
module.exports = { |
||||
// TODO: Remove the `exit` setting, it can hide broken tests.
|
||||
exit: true, |
||||
ignore: ['./app/scripts/migrations/*.test.js'], |
||||
recursive: true, |
||||
require: ['test/env.js', 'test/setup.js'], |
||||
} |
@ -0,0 +1,5 @@ |
||||
const baseConfig = require('./.mocharc'); |
||||
|
||||
module.exports = Object.assign({}, baseConfig, { |
||||
ignore: [...baseConfig.ignore, './app/scripts/controllers/permissions/*.test.js'] |
||||
}); |
Loading…
Reference in new issue