Skip to content
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

Unhandled error message could be more helpful #30087

Open
Tracked by #29531
vanessayuenn opened this issue Dec 17, 2024 · 0 comments
Open
Tracked by #29531

Unhandled error message could be more helpful #30087

vanessayuenn opened this issue Dec 17, 2024 · 0 comments

Comments

@vanessayuenn
Copy link
Contributor

vanessayuenn commented Dec 17, 2024

When using the testing module, any unhandled error can be seen in Storybook:
Image

However, the error message in the terminal is far more useful for debugging my failed test:

storybook/test: ⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
storybook/test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: handleSubmit is not a function
 ❯ onSubmit src/stories/CreateAccount.tsx:67:52
storybook/test: 65|       <div className='form-wrapper'>
     66|         <h2>Create Account</h2>
     67|         <form onSubmit={(e) => {e.preventDefault(); handleSubmit();}} …
       |                                                    ^
     68|           <div className='fullName'>
     69|             <InputField
storybook/test:
storybook/test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Can we pipe this error message instead of (or in addition to??) the stack trace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant