Open MTRNord opened 1 year ago
We are encountering the same problem:
Current Behaviour:
This is important for me too.
That's a blocker when trying to test while you have components with an error boundary in them.
I think it would be nice to add an error handler to the CSF to deal with this, since apparently Decorators can't be used for this. The normal way to do this is to expect an error to be thrown from the render()
.
Skipping a smoke-test would be another good option.
I'm concerned about how slow this seems to be moving. We use chromatic for visual regression testing, including data fetching errors (which happen on load).
Storybook's behavior means that it catches errors when built statically (which is how we do our CI, both test-runner and Chromatic), but it errors when building in dev-mode. So that means that first of all, the smoke-test is disabled when running against a built storybook, which is a bug of its own.
I suspect that has to do with differences in how Storybook behaves in "dev" and "prod" modes.
That means that stories that render errors are incompatible with TDD via test-runner. I'm looking for a workaround but it seems very difficult to change individual stories in a way that would allow testing components with error stories in dev mode.
Another thing I'm interested in is just disabling smoke-tests, since they don't even run in my CI.
This is also stopping us from using Storybook for error usecases. We have fat web-components that make API calls. We dont want to mock the API calls, because we want to test the integration with the BFF (backend-for-frontend). As of now, if the backend responds with an error, Storybook swallows the exception and the catch
part of the API call is never called.
Hey everyone! We just released a test filtering feature in the test-runner v0.15.0, which you can read here.
I know this doesn't really fix the issue, but if it's a blocker because these tests fail, you could use the filtering to skip these specific stories for now. We'll get to this at some point! Thanks for your patience <3
Hi,
I have some stories in which the page will work but since it is based on webapis set by user interaction there will be an error claiming the user is not logged in. This currently fails the test even though this is expected and fine when running in the storybook. Is there any way to catch this error and tell test-runner that it is safe to resume?