Lines Matching refs:mockDispatch
70 function matchHeaders (mockDispatch, headers) { argument
71 if (typeof mockDispatch.headers === 'function') {
75 return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
77 if (typeof mockDispatch.headers === 'undefined') {
80 if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
84 for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
110 function matchKey (mockDispatch, { path, method, body, headers }) { argument
111 const pathMatch = matchValue(mockDispatch.path, path)
112 const methodMatch = matchValue(mockDispatch.method, method)
113 …const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) :…
114 const headersMatch = matchHeaders(mockDispatch, headers)
151 …matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, …
217 function mockDispatch (opts, handler) { function
220 const mockDispatch = getMockDispatch(this[kDispatches], key)
222 mockDispatch.timesInvoked++
225 if (mockDispatch.data.callback) {
226 mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
230 const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
231 const { timesInvoked, times } = mockDispatch
234 mockDispatch.consumed = !persist && timesInvoked >= times
235 mockDispatch.pending = timesInvoked < times
297 mockDispatch.call(this, opts, handler)
346 mockDispatch, property