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

Star matching does not work '*' #81

Closed
nicko-winner opened this issue Dec 7, 2023 · 5 comments
Closed

Star matching does not work '*' #81

nicko-winner opened this issue Dec 7, 2023 · 5 comments

Comments

@nicko-winner
Copy link
Contributor

nicko-winner commented Dec 7, 2023

* pattern matches do not work as documented in MSW, when using playwright-msw.

Used to work in version: 0.2.2

After upgrades to:

  1. playwright-msw 2.2.1 msw 1.x and
  2. playwright-msw 3.0.0 msw 2.0.1
http.get('*', ({ request }) => { ... }

Results in: "SyntaxError: Invalid regular expression: /^(\w+://[^/]+)?/?(?.)?$/: Nothing to repeat"

http.get('/some/url*', ({ request }) => { ... }

Will not match URL

http.get('/so*/url*', ({ request }) => { ... }

Will not match URL

URLs without star matching work great.

@nicko-winner nicko-winner changed the title Start matching does not work. Star matching does not work '*' Dec 7, 2023
@nicko-winner
Copy link
Contributor Author

I have a fix for this i'll put up shortly.

@nicko-winner
Copy link
Contributor Author

#84

@valendres
Copy link
Owner

Thanks for raising this issue and creating a PR @nicko-winner. Not being able to do wildcard matching is definitely unintentional. Looks like there's a minor type issue on the PR, but that's okay. I'll help get this merged and released ASAP.

@valendres
Copy link
Owner

valendres commented Dec 9, 2023

This issue has been resolved in [email protected] 🎉

@nicko-winner
Copy link
Contributor Author

nicko-winner commented Dec 11, 2023

Thanks for the help getting that merged @valendres. Appreciate all your work on this project, and the recent support for MSW 2.0.

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

No branches or pull requests

2 participants