jest-redux-snap
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -105,10 +105,15 @@ 'use strict'; | ||
app.snapAction = function (action) { | ||
if (typeof action !== 'function') { | ||
(0, _snap2.default)(action); | ||
app.snap = function (action) { | ||
if (!action) { | ||
expect(app.tree()).toMatchSnapshot(); | ||
} else { | ||
var actionShot = typeof action !== 'function' ? action : 'thunk'; | ||
(0, _snap2.default)(actionShot); | ||
store.dispatch(action); | ||
(0, _snap2.default)(store.getState()); | ||
app.snap(); | ||
} | ||
store.dispatch(action); | ||
(0, _snap2.default)(store.getState()); | ||
app.snap(); | ||
return app; | ||
}; | ||
@@ -115,0 +120,0 @@ |
{ | ||
"name": "jest-redux-snap", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "reactive test helpers for redux and jest", | ||
@@ -53,2 +53,3 @@ "main": "dist/index.js", | ||
"redux": "^3.x", | ||
"redux-thunk": "^2.2.0", | ||
"rimraf": "^2.6.0" | ||
@@ -55,0 +56,0 @@ }, |
@@ -189,3 +189,3 @@ # Jest Redux Snap | ||
### app.snapAction(action) | ||
### app.snap(action) | ||
The equivalent of: | ||
@@ -192,0 +192,0 @@ |
24218
280
21