# redux-devtools-test-generator

> Generate tests for redux devtools.

Latest version **0.6.2** (published 2020-09-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install redux-devtools-test-generator
pnpm add redux-devtools-test-generator
yarn add redux-devtools-test-generator
bun add redux-devtools-test-generator
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.6.2 |
| Published | 2020-09-07 |
| First published | 2016-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 49.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mihail Diordiev |
| Maintainers | timdorr, zalmoxisus, methuselah96 |
| Keywords | redux, devtools, test, flux, react, hot reloading, time travel, live edit |

## Links

- npm: https://www.npmjs.com/package/redux-devtools-test-generator
- Repository: https://github.com/reduxjs/redux-devtools
- Issues: https://github.com/reduxjs/redux-devtools/issues
- npm.io page: https://npm.io/package/redux-devtools-test-generator

## Dependencies (9)

- [jsan](https://npm.io/package/jsan.md) ^3.1.13
- [devui](https://npm.io/package/devui.md) ^1.0.0-6
- [react](https://npm.io/package/react.md) ^16.13.1
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [es6template](https://npm.io/package/es6template.md) ^1.0.5
- [object-path](https://npm.io/package/object-path.md) ^0.11.4
- [react-icons](https://npm.io/package/react-icons.md) ^3.10.0
- [simple-diff](https://npm.io/package/simple-diff.md) ^1.6.0
- [javascript-stringify](https://npm.io/package/javascript-stringify.md) ^2.0.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.6.2 (latest) — 2020-09-07
- 0.6.1 — 2020-08-14
- 0.6.0 — 2020-08-02
- 0.5.1 — 2017-06-03
- 0.5.0 — 2017-03-15
- 0.4.1 — 2016-11-24
- 0.4.0 — 2016-11-23
- 0.3.2 — 2016-11-19
- 0.3.1 — 2016-10-10
- 0.3.0 — 2016-10-10
- 0.2.2 — 2016-08-14
- 0.2.1 — 2016-08-14
- 0.2.0 — 2016-08-13
- 0.2.0-alpha-7 — 2016-08-12
- 0.2.0-alpha-6 — 2016-08-12
- … 12 more at https://npm.io/package/redux-devtools-test-generator/versions

## README

# Redux DevTools Test Generator

### Installation

```
npm install --save-dev redux-devtools-test-generator
```

### Usage

If you use [Redux DevTools Extension](https://github.com/zalmoxisus/redux-devtools-extension), [Remote Redux DevTools](https://github.com/zalmoxisus/remote-redux-devtools) or [RemoteDev](https://github.com/zalmoxisus/remotedev), it's already there, and no additional actions required.

With [`redux-devtools`](https://github.com/reduxjs/redux-devtools) and [`redux-devtools-inspector`](https://github.com/reduxjs/redux-devtools/packages/redux-devtools-inspector):

##### `containers/DevTools.js`

```js
import React from 'react';
import { createDevTools } from 'redux-devtools';
import Inspector from 'redux-devtools-inspector';
import TestGenerator from 'redux-devtools-test-generator';
import mochaTemplate from 'redux-devtools-test-generator/lib/redux/mocha'; // If using default tests.

const testComponent = (props) => (
  <TestGenerator
    expect={mochaTemplate.expect} wrap={mochaTemplate.wrap} useCodemirror
    {...props}
  />
);

export default createDevTools(
  <Inspector
    tabs: defaultTabs => [...defaultTabs, { name: 'Test', component: testComponent }]
  />
);
```

Instead of `mochaTemplate.expect` and `mochaTemplate.wrap` you can use your function templates.

If `useCodemirror` specified, include `codemirror/lib/codemirror.css` style and optionally themes from `codemirror/theme/`.

### Props

| Name              | Description                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `assertion`       | String template or function with an object argument containing `action`, `prevState`, `curState` keys, which returns a string representing the assertion (see the [function](https://github.com/zalmoxisus/redux-devtools-test-generator/blob/master/src/redux/mocha/index.js#L1-L3) or [template](https://github.com/zalmoxisus/redux-devtools-test-generator/blob/master/src/redux/mocha/template.js#L1)). |
| [`wrap`]          | Optional string template or function which gets `assertions` argument and returns a string (see the example [function](https://github.com/zalmoxisus/redux-devtools-test-generator/blob/master/src/redux/mocha/index.js#L5-L14) or [template](https://github.com/zalmoxisus/redux-devtools-test-generator/blob/master/src/redux/mocha/template.js#L3-L12)).                                                  |
| [`useCodemirror`] | Boolean. If specified will use codemirror styles.                                                                                                                                                                                                                                                                                                                                                            |
| [`theme`]         | String. Name of [the codemirror theme](https://codemirror.net/demo/theme.html).                                                                                                                                                                                                                                                                                                                              |

### License

MIT

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