-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: support relative paths when generating rest handlers #268
feat: support relative paths when generating rest handlers #268
Conversation
12469b7
to
0695b58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for fixing this, @timkolotov! 🎉
@kettanaito Something seems to be very wrong with the CI. I don't know much about CI in GitHub, but perhaps |
Yeah, the issue seems to be not related to your changes. I will look into that. |
@kettanaito anything here? |
@kettanaito fixed it, I guess #270 (still can't request the review) |
Thanks for fixing that, @timkolotov. Could you please rebase this branch? The CI issue should be gone then. |
0695b58
to
0179761
Compare
Seems all good now 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Released: v0.12.0 🎉This has been released in v0.12.0! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Removes usage of URL constructor in
createUrlBuilder
which is used for generating REST handlers.Approach with strings concatenation allows us to use relative paths without specific hostnames, provide prefixes, and also use parameters in the baseUrl that will be handled by MSW.
I also added removing trailing slashes from the baseUrl, as previously it could be passed with and without it and won't affect the result, so I keep it like it was to avoid breaking changes.
Additionally updated tests for the function: removed the leading slash. Because
buildUrl
calls insidegenerateRestHandlers
have no leading shashes so tests weren't exactly correct.(ref: #267)