MCPcopy
hub / github.com/mswjs/msw / test

Function test

src/core/handlers/RequestHandler.ts:261–275  ·  view source on GitHub ↗

* Test if this handler matches the given request. * * This method is not used internally but is exposed * as a convenience method for consumers writing custom * handlers.

(args: {
    request: Request
    resolutionContext?: ResponseResolutionContext
  })

Source from the content-addressed store, hash-verified

259 * handlers.
260 */
261 public async test(args: {
262 request: Request
263 resolutionContext?: ResponseResolutionContext
264 }): Promise<boolean> {
265 const parsedResult = await this.parse({
266 request: args.request,
267 resolutionContext: args.resolutionContext,
268 })
269
270 return this.predicate({
271 request: args.request,
272 parsedResult,
273 resolutionContext: args.resolutionContext,
274 })
275 }
276
277 protected extendResolverArgs(_args: {
278 request: Request

Callers 15

query.test.tsFile · 0.85
link.test.tsFile · 0.85
cookies.test.tsFile · 0.85
variables.test.tsFile · 0.85
logging.test.tsFile · 0.85
mutation.test.tsFile · 0.85
errors.test.tsFile · 0.85

Calls 2

parseMethod · 0.45
predicateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…