mocks property

MatrixMocks? mocks
final

The mocks of the platform side of what the module of the tests runs in an app, such as its part of the start-up of the app and its services, or null if it needs none.

An app runs the start-up and the services of all of its modules, and a test of any of them may run them, as a test that starts the app with main() does, while only the tests of each module know its platform side. So the matrix sets up the mocks of all the tests that apply to an app before the tests of each test file of the app, whichever module the file tests (see addAppTests), and the tests that apply to every app with a module declare the mocks of the module. A test file may set up mocks of its own after them, in its setUpAll, its setUp or its tests rather than while its main() declares them, such as mocks that record what reaches the platform side of its module.

The mocks also put the app into the state that the tests of the other modules expect when they start it. So a module with a guard of the routes, which keeps the user from the screens of the app until a condition holds, opens the guard there: the tests of the other modules expect those screens, and the test of the walk of the routes fails on each guard that does not allow, by its name. A test of the module that needs the guard closed closes it again itself.

Implementation

final MatrixMocks? mocks;