Skip to main content

Select scenario

Makes sure that @ng-apimock/core returns the given scenario for the request matching the mock.

Usage

selectScenario(name, scenario);

Parameters

NameTypeDetails
namestringname of the mock
scenariostringname of the scenario

Example

selectScenario('my-mock', 'my-awesome-scenario'); 

Executing this will select scenario my-awesome-scenario for the mock matching the name my-mock.

PassThrough

There is one special scenario called passThrough. When this scenario is selected, the request will be passed through to the actual backend.

note

When calling selectScenario without a scenario, it will recognize it as passThrough.