Unit test manager. Manages tests for actions/reducers and components. Usually used with action/component manager.
Methods
(static) add(feature, name, argsopt)
Add the unit test boilerplate file for a component.
Example
const test = require('rekit-core').test;
test.add('home', 'Hello');
// Result => Create the unit test boilerplate file at: 'tests/features/home/Hello.test.js'.
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
feature |
string | The feature name. |
|||||||||||
name |
string | The component name. |
|||||||||||
args |
Object |
<optional> |
The args passed to rekit-core/template. Properties
|
(static) addAction(feature, name, argsopt)
Add the unit test boilerplate file for an action (using different templates for sync or async).
Example
const test = require('rekit-core').test;
test.addAction('home', 'doSomething', { isAsync: true });
// Result => Create the unit test boilerplate file at: 'tests/features/home/redux/doSomething.test.js'.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
feature |
string | The feature name. |
||||||||||||||||
name |
string | The action name. |
||||||||||||||||
args |
Object |
<optional> |
The args passed to rekit-core/template. Properties
|
(static) move(source, target)
Move/rename the unit test file for a component.
Parameters:
Name | Type | Description |
---|---|---|
source |
ElementArg | Which component test to move. |
target |
ElementArg | The target location of the component test. |
(static) moveAction(source, target, argsopt)
Move/rename the unit test file for an action.
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source |
ElementArg | Which action test to move. |
|||||||||||
target |
ElementArg | The target location of the action test. |
|||||||||||
args |
Object |
<optional> |
Only used to indicates if it's async. Properties
|
(static) remove(feature, name)
Remove the unit test file for a component.
Example
const test = require('rekit-core').test;
test.remove('home', 'Hello');
// Result => Delete the test file of: 'tests/features/home/Hello.test.js'.
Parameters:
Name | Type | Description |
---|---|---|
feature |
string | The feature name. |
name |
string | The component name. |
(static) removeAction(feature, name)
Remove the unit test file for an action (either sync or async).
Parameters:
Name | Type | Description |
---|---|---|
feature |
string | The feature name. |
name |
string | The action name. |