configuration_mock
Allows to create mock implementations of Configuration
, compatible to the "axConfiguration"
injection.
Contents
Module Members
Module Members
create( configByPath )
Creates a mock Configuration
, compatible to the "axConfiguration" injection of a widget.
The accessor methods get
and ensure
are spied.
The mock behaves just like the actual configuration, except that configuration values may be initialized
from paths, not just regular nested JSON objects. This simplifies mocking of nested configuration such as
logging.threshold
. Usage of this feature is optional, nested objects work just as well.
Parameters
Property | Type | Description |
---|---|---|
configByPath | Object |
path-to-value mappings for the mock |
Returns
Type | Description |
---|---|
Configuration |
a fresh mock instance |