(mockDispatch, { path, method, body, headers })
| 139 | } |
| 140 | |
| 141 | function matchKey (mockDispatch, { path, method, body, headers }) { |
| 142 | const pathMatch = matchValue(mockDispatch.path, path) |
| 143 | const methodMatch = matchValue(mockDispatch.method, method) |
| 144 | const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true |
| 145 | const headersMatch = matchHeaders(mockDispatch, headers) |
| 146 | return pathMatch && methodMatch && bodyMatch && headersMatch |
| 147 | } |
| 148 | |
| 149 | function getResponseData (data) { |
| 150 | if (Buffer.isBuffer(data)) { |
no test coverage detected