@mocksmith/scenarios
v0.3.3
Published
Named, declarative scenarios for mocksmith: a session patch plus endpoint overrides, appliable from the CLI, tests or code.
Maintainers
Readme
@mocksmith/scenarios
Named, declarative scenarios for mocksmith: a session patch plus endpoint overrides, applied from the CLI, from tests, or from code.
npm install --save-dev @mocksmith/scenariosRegister the plugin in your config:
import { defineMockerConfig } from 'mocksmith/config';
import { scenarios } from '@mocksmith/scenarios/plugin';
export default defineMockerConfig({
handlers: [handlers],
defaultSessionData: session,
plugins: [scenarios({ dir: './mocks' })],
});Then scenarios have names:
npx mocksmith scenario list
npx mocksmith scenario apply "Degraded shop"
npx mocksmith scenario clearEntry points
| Import | Contents |
| --- | --- |
| @mocksmith/scenarios | defineScenario, defineTestScenario, applyScenarioViaApi, types |
| @mocksmith/scenarios/plugin | the scenarios() plugin and loadScenario (Node) |
| @mocksmith/scenarios/playwright | applyScenario(page, scenario \| name) |
License
MIT
