(mockDispatches, key)
| 57268 | } |
| 57269 | function addMockDispatch(mockDispatches, key, data) { |
| 57270 | const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; |
| 57271 | const replyData = typeof data === "function" ? { callback: data } : { ...data }; |
| 57272 | const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; |
| 57273 | mockDispatches.push(newMockDispatch); |
| 57274 | return newMockDispatch; |
| 57275 | } |
| 57276 | function deleteMockDispatch(mockDispatches, key) { |
| 57277 | const index = mockDispatches.findIndex((dispatch) => { |
| 57278 | if (!dispatch.consumed) { |
| 57279 | return false; |
| 57280 | } |
| 57281 | return matchKey(dispatch, key); |
| 57282 | }); |
| 57283 | if (index !== -1) { |
no test coverage detected
searching dependent graphs…