File

testing/src/test_context.ts

Description

The test context allows for global configuration of services, i.e. to globally register element resolvers.

Index

Properties
Methods
Accessors

Properties

dateLibrary
Type : DateFormattingLibrary
Default value : new MissingDateFormattingLibrary()

Implementation of the date formatting library to use. This must be assigned an actual implementation, ideally the one that is also used for production.

Typically, a date library is configured during the test environment setup, such that it becomes available all tests.

Static Readonly DEFAULT
Default value : new TestContext()

Accesses the default instance of the test context. Modifications to this instance will be seen by other tests

Methods

addElementResolver
addElementResolver(resolver: ElementResolver)

Registers an element resolver with this context.

Parameters :
Name Type Optional
resolver ElementResolver No
Returns : void
addValidationRule
addValidationRule(factory: ValidationRuleFactory)
Parameters :
Name Type Optional
factory ValidationRuleFactory No
Returns : void

Accessors

pageModelService
getpageModelService()

Accesses the PageModelService using the configured element resolvers.

Returns : PageModelService

results matching ""

    No results matching ""