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

[bug] --failOnConsole not working with Mock Service Worker #417

Open
ts213 opened this issue Dec 19, 2023 · 0 comments
Open

[bug] --failOnConsole not working with Mock Service Worker #417

ts213 opened this issue Dec 19, 2023 · 0 comments

Comments

@ts213
Copy link

ts213 commented Dec 19, 2023

Describe the bug
--failOnConsole test parameter is not working (if a test finishes too fast)

To Reproduce
Steps to reproduce the behavior:

clone this repo
git clone https://github.com/ts213/storybook-test-bug
install deps
npm i
launch storybook server
npm run storybook
open a browser console on a newly opened page and verify that the console contains the error:
[MSW] Error: captured a request without a matching request handler....
now run the test-storybook command:
npm run test-storybook -- --failOnConsole
test successfully passes:
Test Suites: 1 passed, 1 total

Expected behavior
Test should fail.

System
Please paste the results of npx storybook@latest info here.

Storybook Environment Info:

  System:
    OS: Linux 5.14
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Shell: 4.4.23 - /bin/bash
  Binaries:
    Node: 18.12.1 - ~/.local/bin/node
    npm: 8.19.2 - ~/.local/bin/npm <----- active
  npmPackages:
    @storybook/addon-essentials: ^7.5.2 => 7.5.2 
    @storybook/addon-interactions: ^7.5.2 => 7.5.2 
    @storybook/addon-links: ^7.5.2 => 7.5.2 
    @storybook/blocks: ^7.5.2 => 7.5.2 
    @storybook/test-runner: ^0.16.0 => 0.16.0 
    @storybook/testing-library: ^0.2.2 => 0.2.2 
    @storybook/vue3: ^7.5.2 => 7.5.2 
    @storybook/vue3-vite: ^7.5.2 => 7.5.2 
    eslint-plugin-storybook: ^0.6.15 => 0.6.15 
    msw-storybook-addon: ^1.10.0 => 1.10.0 
    storybook: ^7.6.5 => 7.6.5 

Additional context
I can make test fail if I deliberately delay a test:
uncomment this line await new Promise((resolve, reject) => setTimeout(resolve, 1100));
in src/stories/Page.stories.js

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

No branches or pull requests

1 participant