# redux-saga-delay-mock

> redux-saga-delay-mock

Latest version **0.0.1** (published 2017-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-saga-delay-mock
pnpm add redux-saga-delay-mock
yarn add redux-saga-delay-mock
bun add redux-saga-delay-mock
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-12-19 |
| First published | 2017-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rob Gilson |
| Maintainers | d1plo1d |

## Links

- npm: https://www.npmjs.com/package/redux-saga-delay-mock
- npm.io page: https://npm.io/package/redux-saga-delay-mock

## Recent versions

- 0.0.1 (latest) — 2017-12-19

## README

## redux-saga-delay-mock

Intercept and test against delays with redux-saga-tester without tying your tests to your implementation.

Currently only compatible with the master branch of redux-saga (as of 1.0.0-beta.0)

### Installation

`yarn add redux-saga-delay-mock`

### Useage

```js
import sagaDelayMock from 'redux-saga-delay-mock'

// ... create various actions and a saga ...

const initialState = {}

const delayMock = sagaDelayMock()
const sagaTester = new SagaTester({
  initialState,
  options: {
    effectMiddlewares: [delayMock],
  },
})
sagaTester.run(saga)

expect(sagaTester.getCalledActions()).toEqual([
  beforeDelayAction
])

const pause = await delayMock.waitForDelay()
expect(pause.length).toBe(60*1000)
pause.next()

expect(sagaTester.getCalledActions()).toEqual([
  beforeDelayAction,
  afterDelayAction,
])
```

---
_Source: https://npm.io/package/redux-saga-delay-mock · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
