refactor(playwright): use msw playwright binding #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In mswjs/playwright#21 (comment), I offered help with updating some msw examples and this is the first attempt at doing so.
Initial problem with the setup file being recognized as a test file
Now, at least on my system (Windows, PowerShell), the main problem with this pull request (which is why it's in draft) is that it doesn't work. Running
pnpm run test
in the playwright example always produces the following error:As far as I understand https://playwright.dev/docs/test-global-setup-teardown, this error shouldn't happen. The setup file and configuration is written in such a way that
playwright.setup.ts
shouldn't be considered a test file, but Playwright still thinks so. So far, I haven't found a configuration that would make this work.Notes
UpdatingAfter a rebase withmsw
became necessary because@msw/playwright
has a peer dependency onmsw@^2.10.3
main
, this became unnecessary asmsw
was updated in the meantimeplaywright
became necessary due to aTypeError: this[#page].routeWebSocket is not a function
errorsChanges
Add @msw/playwright to the playwright example.
Update Playwright to avoid TypeError: this[#page].routeWebSocket is not a function errors when using @msw/playwright.
Use the
@msw/playwright
binding