redux-actions-assertions
Version:
Assertions for redux actions testing
66 lines (56 loc) • 2.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.registerAssertions = undefined;
var _reduxActionsAssertionsJs = require('redux-actions-assertions-js');
function toDispatchActions() {
return {
compare: function compare(action, expectedActions, done) {
_reduxActionsAssertionsJs.assertions.toDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
},
negativeCompare: function negativeCompare(action, expectedActions, done) {
_reduxActionsAssertionsJs.assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
} /* eslint-env jasmine */
function toNotDispatchActions() {
return {
compare: function compare(action, expectedActions, done) {
_reduxActionsAssertionsJs.assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toDispatchActionsWithState() {
return {
compare: function compare(action, state, expectedActions, done) {
_reduxActionsAssertionsJs.assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
},
negativeCompare: function negativeCompare(action, state, expectedActions, done) {
_reduxActionsAssertionsJs.assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toNotDispatchActionsWithState() {
return {
compare: function compare(action, state, expectedActions, done) {
_reduxActionsAssertionsJs.assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
var matchers = {
toDispatchActions: toDispatchActions,
toNotDispatchActions: toNotDispatchActions,
toDispatchActionsWithState: toDispatchActionsWithState,
toNotDispatchActionsWithState: toNotDispatchActionsWithState
};
function registerAssertions() {
jasmine.addMatchers(matchers);
}
exports.registerAssertions = registerAssertions;