Members
(static) dependencies :Array.<string>
Class dependencies:
['app', 'file', 'helper.path', 'helper.string']
.
scope :string
Folder scope accessor.
Should be a valid folder in the test directory.
stringHelper :support.helpers.StringHelper
String helper.
Methods
all()
Get all the tests from the root namespace.
Returns:
All tests.
- Type
- Array.<{file: string, instance: TestCase, name: string, namespace: string, tests: Array.<{method: string, description: string}>}>
fromNamespace(testNamespaceopt)
Get all the tests from the given namespace.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testNamespace |
string |
<optional> |
The namespace folder. |
Returns:
All tests from namespace.
- Type
- Array.<{file: string, instance: TestCase, name: string, namespace: string, tests: Array.<{method: string, description: string}>}>
getFiles()
Get a file list that matches the test class pattern.
Returns:
The files from the root folder.
- Type
- Array.<string>
getFilesFrom(folderopt)
Get a file list from the given folder that matches the test class pattern.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
folder |
string |
<optional> |
""
|
The folder to search. |
Returns:
The files from the searched folder.
- Type
- Array.<string>
getNamespaceFromFile(file)
Get the namespace from full file path.
Parameters:
Name | Type | Description |
---|---|---|
file |
string | The test file path. |
Returns:
The file namespace.
- Type
- string
getFormattedNamespaceFromFile(file)
Get human-readable namespace from full file path.
Parameters:
Name | Type | Description |
---|---|---|
file |
string | The test file path. |
Returns:
The formatted namespace.
- Type
- string
getFormattedNameFromFile(file)
Get human-readable name from full file path.
Parameters:
Name | Type | Description |
---|---|---|
file |
string | The test file path. |
Returns:
The formatted name.
- Type
- string
getTestsFromInstance(instance)
Get all the test methods and their descriptions of a given TestCase instance.
Parameters:
Name | Type | Description |
---|---|---|
instance |
test.TestCase | The test case instance. |
Returns:
The tests methods and descriptions from the test case instance.
- Type
- Array.<{method: string, description: string}>
getTestMethods(instance)
Get all instance methods that are actual test cases.
Parameters:
Name | Type | Description |
---|---|---|
instance |
test.TestCase | The test case instance. |
Returns:
List of all instance test methods.
- Type
- Array.<string>
testMethodName(methodName)
Test method name to verify if its a test case method name.
Parameters:
Name | Type | Description |
---|---|---|
methodName |
string | The method name. |
Returns:
Indicates that the method name is a valid test method name.
- Type
- boolean
getFormattedDescription(methodName)
Get human-readable test case description.
Parameters:
Name | Type | Description |
---|---|---|
methodName |
string | The method name. |
Returns:
The formatted description based on method name.
- Type
- string
setBasePath(basePath)
Set current base path.
Parameters:
Name | Type | Description |
---|---|---|
basePath |
string | Base test path. |
Returns:
Current test repository instance.
setPattern(pattern)
Set current regular expression pattern to test test case classes.
Parameters:
Name | Type | Description |
---|---|---|
pattern |
string | RegExp | Test file pattern. |
Returns:
Current test repository instance.
reset()
Reset test repository static base path and pattern.