Skip to content

[Demo] Migrate from fetch-mock to msw #10844

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

[Demo] Migrate from fetch-mock to msw #10844

wants to merge 9 commits into from

Conversation

erwanMarmelab
Copy link
Contributor

@erwanMarmelab erwanMarmelab commented Jul 21, 2025

Problem

fetch-mock brings us back some vulnerabilities.

Solution

Change it for MSW

To Do

  • demo
  • crm
  • simple

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • [ ] The PR includes unit tests (if not possible, describe why)
  • [ ] The PR includes one or several stories (if not possible, describe why)
  • [ ] The documentation is up to date

const data = generateData();
const restServer = JsonGraphqlServer({ data });
const handler = restServer.getHandler();
const handlerWithLogs = (url: string, opts: any) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to keep it. If we don't pass quiet: true to worker.start, it will automatically displays us the right logs 👍

@erwanMarmelab erwanMarmelab added RFR Ready For Review and removed WIP Work In Progress labels Jul 21, 2025
@djhi djhi self-requested a review July 21, 2025 15:24
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, except you probably didn't test the graphql demo which is broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Development

Successfully merging this pull request may close these issues.

2 participants