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

Chore: Enable MSW in web/test-runner + add tests for state manager + isCurrentUser util #17584

Open
wants to merge 13 commits into
base: v15/dev
Choose a base branch
from

Conversation

madsrasmussen
Copy link
Contributor

This PR sets up MSW in our test runner, so we can use mock data for our HTTP requests during testing. I have hit a couple of bumps that we'll need to address later on:

  • I had to turn off the mocks for the installer because it's using a Vite variable that just doesn't play nice with the test runner. Since we don’t really need to run the backoffice installer with mocks at the moment, I think it's fine to leave it like this for now.

  • I had to duplicate the mockServiceWorker.js file. The test runner can’t locate it in the /public folder, and Vite can’t find it in the project root. Once we upgrade to MSW 2.1, it'll be able to generate the file in multiple locations, so that’s another reason to prioritize the upgrade!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant