@absolunet/ioc2.1.0

View on GitHub

Tester

Tester that runs tests through test repositories.

Extends

Members

(static) dependencies :Array.<string>

Source:
Class dependencies: ['app'].

runner :test.services.TestRunner

Source:
Test runner accessor.

kernel :foundation.Kernel

Source:
Current kernel accessor.

engine :*

Source:
Inherited From:
Current engine accessor.

Methods

boot()

Source:
Boot the tester and create a fresh application instance.

bootIfNotBooted()

Source:
Boot the tester if it was not booted yet.

run(repositoryNameopt, beforeEachClosureopt)

Source:
Run tests from a given repository abstract name.
Parameters:
Name Type Attributes Default Description
repositoryName string <optional>
"test" The test repository short name.
beforeEachClosure function <optional>
The callback to run each atime a test will run.

setEngine(engineName)

Source:
Overrides:
Set current test engine. Set runner test engine as well.
Parameters:
Name Type Description
engineName string | Engine Either a test engine short name, such as "jest", or a test engine instance.

createFreshApplication()

Source:
Create a fresh application by flushing all existing bindings.
Returns:
The fresh application instance.
Type
Application

setRunner(runner)

Source:
Set test runner instance. It allows the tester to keep a singleton even if the application is flushed after every test.
Parameters:
Name Type Description
runner test.services.TestRunner Test runner instance.

setKernel(kernel)

Source:
Set the application kernel. It allows the tester to keep a singleton of the kernel constructor even if the application and the cache are flushed after every test.
Parameters:
Name Type Description
kernel foundation.Kernel The kernel instance.