refactor(playwright): use msw playwright binding#131
Open
kleinfreund wants to merge 1 commit intomswjs:mainfrom
Open
refactor(playwright): use msw playwright binding#131kleinfreund wants to merge 1 commit intomswjs:mainfrom
kleinfreund wants to merge 1 commit intomswjs:mainfrom
Conversation
e424296 to
904ca8d
Compare
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
b39b4a7 to
a80b6a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 testin 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.tsshouldn'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 withmswbecame necessary because@msw/playwrighthas a peer dependency onmsw@^2.10.3main, this became unnecessary asmswwas updated in the meantimeplaywrightbecame necessary due to aTypeError: this[#page].routeWebSocket is not a functionerrorsChanges
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/playwrightbinding