Single test runner loads only test files that are listed in config.json file. Configuration reflects folders structure.
Example folder: client/state/plugins/wporg/test/
Test files we want to add to the runner:
actions
selectors
reducer.js
It translates into the following code in the config file:
{
"state": {
"plugins": {
"wporg": {
"test": [ "actions", "selectors", "reducer" ]
}
}
}
Test output for added files:
...
state
plugins
wporg
reducer (taken from describe inside the file)
√ Test name
test-actions
√ Test name
test-selectors
√ Test name
...
The exclusivity feature allows you to run only the specified suite or test-case by appending .only()
to the function.
It works with describe
and it
functions. More details in Mocha documentation.