@absolunet/ioc2.1.0

View on GitHub

EndToEndTestRepository

End to end test repository that scopes to the "e2e" folder.

Extends

Members

scope :string

Source:
Overrides:
Folder scope accessor. Should be a valid folder in the test directory.

basePath :string

Source:
Inherited From:
Current base path accessor.

pattern :string|RegExp

Source:
Inherited From:
Current pattern accessor.

Methods

all()

Source:
Inherited From:
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)

Source:
Inherited From:
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()

Source:
Inherited From:
Get a file list that matches the test class pattern.
Returns:
The files from the root folder.
Type
Array.<string>

getFilesFrom(folderopt)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
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)

Source:
Inherited From:
Set current base path.
Parameters:
Name Type Description
basePath string Base test path.
Returns:
Current test repository instance.
Type
test.repositories.TestRepository

setPattern(pattern)

Source:
Inherited From:
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.
Type
test.repositories.TestRepository

reset()

Source:
Inherited From:
Reset test repository static base path and pattern.