Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 974 Bytes

README.md

File metadata and controls

44 lines (36 loc) · 974 Bytes

Single test runner

Single test runner loads only test files that are listed in config.json file. Configuration reflects folders structure.

Extending config.json

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
...

How to run specified suite or test-case

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.