-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Mock TypeError custom override #1202
Comments
@soartec-lab assigned this to you as you fixed the original ticket. |
Similar to #1201 |
@dipsaus9 |
I have fixed the issue where it did not work correctly by #1205 when enum types were included. |
I'll test it as the release is out there. With the return type now added to the
This is great. But if you want to override this value with the override function we can not type the enum. As an example in the config we currently have.
The expected return type is a list of enum. In the previous version this would result in no errors. With the strict return type the Hope this clarifies the issue. |
Hi, @dipsaus9 Since we released "v6.25.0" this issue has been fixed 👍 |
@soartec-lab Release v6.25.0 did not fix our issue. |
When using the override mock option the TypeCheck is too strict
With the release of 6.24 orval introduced the return type for the mws files, see #1171.
When using the override option for certain opperations the TypeCheck is too strict, without any options to set the type.
As orval uses
js
to parse the document we can not add extra type declarations to the config. This breaks ourorval.config.js
mock
totrue
What happens?
TypeErrors in the
.msw.ts
fileWhat were you expecting to happen?
Not sure what the best solution is. The return type is a nice feature, but maybe we should be able to override the return value, or not set it in case of the override function in the config. As orval uses JavaScript and not TypeScript we can not strictly type the return value in the config.
Any logs, error output, etc?
Not at the moment, if you need more details I can add it.
Any other comments?
Open for suggestions.
The text was updated successfully, but these errors were encountered: