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

Fix StorybookTestRunnerError – length on undefined #194

Merged
merged 1 commit into from Oct 7, 2022

Commits on Sep 21, 2022

  1. Fix StorybookTestRunnerError – length on undefined

    When running `yarn test-storybook` on my story, a 3rd party library throws an uncaught exception, but `StorybookTestRunnerError` _assumes_ `logs` is an array, which throws this error:
    
    ```console
    UnhandledPromiseRejectionWarning: page.evaluate: TypeError: Cannot read properties of undefined (reading 'length')
        at new StorybookTestRunnerError (<anonymous>:58:34)
        at __throwError (<anonymous>:71:15)
        at eval (eval at evaluate (:192:30), <anonymous>:4:19)
        at UtilityScript.evaluate (<anonymous>:194:17)
        at UtilityScript.<anonymous> (<anonymous>:1:44)
    ```
    
    This PR simply **defaults `logs` to `[]`**, so I can correctly see that the underlying error is _actually_ coming from a 3rd party library:
    
    ```console
     Cannot read properties of null (reading 'focus')
    ```
    ericclemmons committed Sep 21, 2022
    Copy the full SHA
    13b7cf6 View commit details
    Browse the repository at this point in the history