# redux-tdd

> Dot-chaining syntax for testing the Redux data-flow of React components

Latest version **1.1.0** (published 2017-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-tdd
pnpm add redux-tdd
yarn add redux-tdd
bun add redux-tdd
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-11-03 |
| First published | 2017-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 94 |
| Maintainers | lmatteis |

## Links

- npm: https://www.npmjs.com/package/redux-tdd
- Repository: https://github.com/lmatteis/redux-tdd
- Homepage: https://github.com/lmatteis/redux-tdd#readme
- Issues: https://github.com/lmatteis/redux-tdd/issues
- npm.io page: https://npm.io/package/redux-tdd

## Recent versions

- 1.1.0 (latest) — 2017-11-03
- 1.0.0 — 2017-10-19
- 0.0.5 — 2017-09-03
- 0.0.4 — 2017-09-03
- 0.0.3 — 2017-09-03
- 0.0.2 — 2017-09-03
- 0.0.1 — 2017-09-03

## README

## Redux TDD

### Install

`npm install --save-dev redux-tdd`

```js
import reduxTdd from 'redux-tdd';

// reduxTdd() takes as arguments an object which will be passed to redux combineReducers()
// and a function which returns an array of components that map your state to props
reduxTdd({ counter: counterReducer }, state => [
  <Counter
    onClick={incrementAction}
    counter={state.counter.count} />
])
.action(props => props.onClick()) // action() takes a function that must return a redux action
.toMatchProps({ counter: 1 }) // toMatchProps() checks whether the component took the correct props
.contains(<span>1</span>) // finally contains() checks that the component contains correct value
```

### About

Check out my HOW-TO article on Hacker Noon: https://hackernoon.com/redux-tdd-a-deep-dive-344cd7682a54

Also you can read more about this technique in our freeCodeCamp article: https://medium.freecodecamp.org/test-driven-development-with-react-and-redux-using-redux-tdd-3fd3be299918

Also to learn more in depth how to use Redux TDD please look inside the `/test` folder.

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