-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Intergrate with msw
mock service
#1069
Comments
@himself65 What do you do currently? |
Related to #1486 |
Closing this in favour of #1486, please move any discussion there! |
Hey @himself65, are you using MSW Source? What's the benefit for you to have Hey API generate MSW handlers? |
So I don't need manually write random data code |
@himself65 which parts do you still need to write manually when using MSW Source? |
Also, I recently found msw-auto-mock, looks like it also covers all the functionality you might need. (When you prefer static generation over runtime) |
@mkeyy0 did you end up using it? The GenAI feature looks interesting |
No, I've just found it and right now trying it in my repo, I'll give you feedback a bit later during the day |
After a small investigation, it looks like msw-auto-mock doesn't work for me by the following reasons:
Also, some things to say about MSW Source. I quite don't like the approach with runtime-generated data based on the schema, it looks like it also was developed for the browser environment rather than for the test one. Also right now it is not possible to get a specific response for a specific endpoint in a test environment. You can do it by adding I'm not even sure if should we ask for a plugin from your side or if should it be some additional functionality provided by MSW Source package. But from my side what I'd like to have from the plugin:
File as output is the main feature I guess, because it simplifies debugging and you can change it, while in runtime you can't do anything. |
@mkeyy0 just want to say I appreciate these comments! Noted and will be taken into consideration. There's a draft pull request with the MSW plugin btw if you haven't seen, slowly working on it |
Description
I think it's possible to generate mock server handler for better unit testing
The text was updated successfully, but these errors were encountered: