Redux DevTools Test Generator
Watch my presentation at React Europe to see how it works.
Installation
npm install --save-dev redux-devtools-test-generator
Usage
Use with redux-devtools
and redux-devtools-inspector
(support for Redux DevTools Extension will come later).
containers/DevTools.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';
export default createDevTools(
<Inspector
customTabs={{
'Test': <TestGenerator expect={mochaTemplate.expect} wrap={mochaTemplate.wrap} />
}}
/>
);
Instead of mochaTemplate.expect
and mochaTemplate.wrap
you can use your function templates.
Also include codemirror/lib/codemirror.css
style and optionally themes from codemirror/theme/
.
Props
Name | Description |
---|
expect | Function with action , prevState , curState arguments, which returns a string representing the assertion (see the example). |
[wrap ] | Optional function which gets expects argument and returns a string (see the example). |
[theme ] | Name of the codemirror theme as a string. |
License
MIT
Created By
If you like this, follow @mdiordiev on twitter.