-
Notifications
You must be signed in to change notification settings - Fork 8
chore: add msw #14
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
chore: add msw #14
Conversation
|
I have a question. What is the point of the could it be reused for some of the current examples? |
basically we used it in codegate for mocking a specific response of an endpoint in a test case, it is not implemented cause we don't have components that are calling thv APIs and we don't have tests on that. The idea is to add the all the configuration that we will need in future, and build the UI once we completed the requirements overview. So after tomorrow I would expect we can work on UI stuff too |
It is a utility copied from the Codegate UI repo — basically, it infers a template literal type based on a path in the OpenAPI spec, so you get type-hints & type-checking. We added this after we had some bugs where we were mocking non-existent endpoints (they had been renamed, I think), and it was messing with tests. |
src/mocks/handlers.ts
Outdated
| }); | ||
| }), | ||
|
|
||
| http.get("*/api/v1beta/version", () => { |
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.
Can we use the mswEndpoint helper here? (throughout entire file)
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.
right. I added it later but I forgot that I can replace the handlers path
Add MSW, msw-endpoint and fixtures
Sample config for msw-endpoint