-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-designs the RequestHandler API #561
Conversation
b24f764
to
550d5d2
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b96fd21:
|
550d5d2
to
a3d4474
Compare
a3d4474
to
663d96c
Compare
REST API request handlers have been successfully migrated to the new Request Handler API. |
5ecda68
to
c8348d3
Compare
c8348d3
to
932b210
Compare
81ed9fa
to
245e97d
Compare
GraphQL API request handlers have been successfully migrated to the new Request Handler API. |
b9c35eb
to
dbd5bef
Compare
@timdeschryver I'm addressing the types validation in dbd5bef with the |
dbd5bef
to
b96fd21
Compare
It looks like the docs are now out of date on creating Custom Handlers? https://mswjs.io/docs/recipes/custom-request-handler |
GitHub
Motivation
The Request Handler API can be reviewed and improved based on the usage scenarios and request handling workflow that we've learned.
handler.run()
that includes mocked response, as well as additional request information (i.e. parsing results).RequestHandler
class, or any standard request handler exported by the library (i.e.RestHandler
orGraphQLHandler
).Example
Roadmap
rest
request handlers.graphql
request handlers.@fixme
comments.test/msw-api/setup-worker/start/on-unhandled-request/suggestions.test.ts
doesn't error and can perform requests that intentionally fail without polluting the stdout.