Skip to content

Commit 2ec67c2

Browse files
committed
Revert "Add unexpected actions support"
This reverts commit 5ecc07d.
1 parent 5ecc07d commit 2ec67c2

File tree

3 files changed

+1
-86
lines changed

3 files changed

+1
-86
lines changed

src/asserts/actionUtils.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ function notDispatchedError(dispatchedActions, expectedActions, expectedAction)
4141
);
4242
}
4343

44-
function dispatchedError(dispatchedActions, unExpectedActions, unExpectedAction) {
45-
return new Error(
46-
`Expected action ${JSON.stringify(unExpectedAction)} was not dispatched.\n` +
47-
`Expected dispatched actions: ${JSON.stringify(unExpectedActions)}\n` +
48-
`Actual dispatched actions: ${JSON.stringify(dispatchedActions)}`
49-
);
50-
}
51-
5244
function assertDispatchedActions(dispatched, expected) {
5345
const availableActions = dispatched.slice();
5446

@@ -63,24 +55,8 @@ function assertDispatchedActions(dispatched, expected) {
6355
}
6456
}
6557

66-
function assertUnDispatchedActions(dispatched, unExpected) {
67-
const availableActions = dispatched.slice();
68-
69-
for (let indexInExpected = 0; indexInExpected < unExpected.length; indexInExpected++) {
70-
const indexInAvailable = findIndex(availableActions, unExpected[indexInExpected]);
71-
72-
if (indexInAvailable === -1) {
73-
availableActions.splice(indexInAvailable, 1);
74-
} else {
75-
throw dispatchedError(dispatched, unExpected, unExpected[indexInExpected]);
76-
}
77-
}
78-
}
79-
80-
8158
export {
8259
getDispatchedActions,
8360
unrollActions,
84-
assertDispatchedActions,
85-
assertUnDispatchedActions
61+
assertDispatchedActions
8662
};

src/asserts/toNotDispatchActions.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/asserts/toNotDispatchActionsWithState.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)