-
Notifications
You must be signed in to change notification settings - Fork 0
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
Msw update from 1.2.1 to 2.0.1 #521
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this kind of thing in the future, it would be good to write stuff in such a way that the library-specific code is inside a function so that the change can just be made in one place instead of having to change the code everywhere it is used.
@@ -46,14 +37,13 @@ describe('Labware Info Page', () => { | |||
}); | |||
}); | |||
|
|||
context('when I check a flagged labware details', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this test "when I check a flagged labware details" has been deleted. Is it unnecessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted. This is a mistake. I have added it back in.
Yes, I totally agree and I thought about while doing this. I think probably the way to go is a generic function where the library specifics like request and response object can be defined within , which can wrap the required context specific response. |
msw package updated from 1.2.1 to 2.0.1
The main changes are
Call signature changes for graphql mutationn and query ( breaking change from 2.0 - Response resolver call signature is no longer (req, res, ctx) => res() but instead ({ request }) => new Response().)
setupWorker call chnaged to msw/browser
https://github.com/mswjs/msw/releases?page=2
https://mswjs.io/docs/api/graphql/