If the suffix matches, a request is mocked with the value between the suffix and path param. This leads to me not being able to have
/users/1/somepath
and
/users/somepath
as both of these match. The temporary fix is to change the order of these, but that's not really the correct answer to this.
Browser
msw: 0.21.3nodejs: 13.14.0npm: 6.14.4Steps to reproduce the behavior:
/user/:userId/endofpath in Request handler URL and /user/0251e7ac/test/abc/endofpath in Actual request URLIt should not match

Hi @pkkummermo thanks for raising this :).
What you are saying is correct, thanks !!! I'll fix in a while :).
The issue is causing by https://github.com/mswjs/node-match-path/blob/e1e0fac2c335629ac1dd345c297e76d5ea922c92/src/pathToRegExp.ts#L18-L20 because we are not removing /
The fix from @marcosvega91 has been published in [email protected].
@pkkummermo could you please re-install your project's dependencies (npm install --force) and let us know that the issue is fixed? Thanks.
@kettanaito
No go, but the package-lock of msw says
"node-match-path": "^0.4.4",
Which I guess means that it will only keep bumping patches, not minors.
Thanks for letting me know. The fix will propagate in the next release of msw then.
Thank you so much for the quick fix :)
Most helpful comment
Hi @pkkummermo thanks for raising this :).
What you are saying is correct, thanks !!! I'll fix in a while :).
The issue is causing by https://github.com/mswjs/node-match-path/blob/e1e0fac2c335629ac1dd345c297e76d5ea922c92/src/pathToRegExp.ts#L18-L20 because we are not removing
/