Skip to content
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

Merged
merged 26 commits into from
Jan 23, 2024
Merged

Msw update from 1.2.1 to 2.0.1 #521

merged 26 commits into from
Jan 23, 2024

Conversation

seenanair
Copy link
Contributor

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/

@seenanair seenanair marked this pull request as draft December 19, 2023 17:15
Copy link
Contributor

@khelwood khelwood left a 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', () => {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@seenanair
Copy link
Contributor Author

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.

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.

@seenanair seenanair requested a review from khelwood January 15, 2024 15:53
@seenanair seenanair marked this pull request as ready for review January 22, 2024 13:11
@seenanair seenanair merged commit c9620ef into devel Jan 23, 2024
9 checks passed
@seenanair seenanair deleted the x1034_msw_update branch January 23, 2024 12:30
@seenanair seenanair restored the x1034_msw_update branch January 23, 2024 13:19
seenanair added a commit that referenced this pull request Jan 23, 2024
This reverts commit c9620ef, reversing
changes made to 5edbd64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants