Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including redux-devtools-gentest-plugin with all npm packages installed. Try it out:

require("redux/package.json"); // redux is a peer dependency. require("react-redux/package.json"); // react-redux is a peer dependency. var reduxDevtoolsGentestPlugin = require("redux-devtools-gentest-plugin")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

redux-devtools-gentest-plugin v1.0.5

Generate mocha like tests from redux-devtools session

redux-devtools-gentest-plugin

npm version semantic-release Build Status

DEMO

Installation

npm i redux-devtools-gentest-plugin --save-dev

Usage

To use it with redux-devtools in your project you only need to add

  import {TestMonitor} from 'redux-devtools-gentest-plugin';
  ...
   <DebugPanel top left bottom>
        <DevTools store={store}
                    monitor={TestMonitor}/>
    </DebugPanel>

(look at */todomvc/containers/App.js file)

to export tests click Copy To Buffer button in the end of left panel.

generated tests are a little bit specific for now they look for reducers in upper directory

import * as reducers from '../reducers';

Running Examples

You can do this:

git clone https://github.com/lapanoid/redux-devtools-gentest-plugin.git
cd redux-devtools
npm install

cd examples/counter
OR
cd examples/todomvc
npm install
npm start
open http://localhost:3000

check out exported tests here

todomvc/tests/generatedTests.js

you can run it with

mocha --compilers js:babel/register generatedTests.js

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free