@@ -6,20 +6,41 @@ function withState(state) {
66 this . obj = new ActionWithInitialState ( this . obj , state ) ;
77}
88
9- function dispatchActions ( expectedActions , done ) {
9+ function dispatchActionsFunction ( assert , assertWithState , expectedActions , done ) {
1010 if ( this . obj instanceof ActionWithInitialState ) {
1111 const action = this . obj . action ;
1212 const state = this . obj . state ;
13- assertions . toDispatchActionsWithState ( state , action , expectedActions , done ) ;
13+ assertWithState ( state , action , expectedActions , done ) ;
1414 } else {
15- assertions . toDispatchActions ( this . obj , expectedActions , done ) ;
15+ assert ( this . obj , expectedActions , done ) ;
1616 }
1717}
1818
19+ function dispatchActions ( expectedActions , done ) {
20+ dispatchActionsFunction . call (
21+ this ,
22+ assertions . toDispatchActions ,
23+ assertions . toDispatchActionsWithState ,
24+ expectedActions ,
25+ done
26+ ) ;
27+ }
28+
29+ function notDispatchActions ( expectedActions , done ) {
30+ dispatchActionsFunction . call (
31+ this ,
32+ assertions . toNotDispatchActions ,
33+ assertions . toNotDispatchActionsWithState ,
34+ expectedActions ,
35+ done
36+ ) ;
37+ }
38+
1939function registerAssertions ( ) {
2040 should . Assertion . add ( 'withState' , withState ) ;
2141 should . Assertion . alias ( 'withState' , 'state' ) ;
2242 should . Assertion . add ( 'dispatchActions' , dispatchActions ) ;
43+ should . Assertion . add ( 'notDispatchActions' , notDispatchActions ) ;
2344}
2445
2546export {
0 commit comments