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]: After ejecting, setupFilesAfterEnv cannot be used #503

Open
IanVS opened this issue Aug 6, 2024 · 0 comments
Open

[Bug]: After ejecting, setupFilesAfterEnv cannot be used #503

IanVS opened this issue Aug 6, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@IanVS
Copy link
Member

IanVS commented Aug 6, 2024

Describe the bug

I wanted to try setting up automatic retries, so I ejected my jest config, and added a setupFilesAfterEnv. But when running tests, I got TypeError: globalThis.__sbPostVisit is not a function when a failure happened in a test.

To Reproduce

  • Eject
  • Add setupFilesAfterEnv, point it to a file (the file doesn't have to do anything)
  • Add await expect('foo').toBe('bar'); in a play function
  • Run the test-runner on that story.

System

System:
    OS: macOS 14.5
    CPU: (12) arm64 Apple M2 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/Library/Caches/fnm_multishells/5945_1721245515083/bin/node
    npm: 10.2.4 - ~/Library/Caches/fnm_multishells/5945_1721245515083/bin/npm
    pnpm: 8.14.2 - ~/Library/Caches/fnm_multishells/5945_1721245515083/bin/pnpm <----- active
  Browsers:
    Edge: 127.0.2651.86
    Safari: 17.5
  npmPackages:
    @storybook/addon-a11y: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    @storybook/addon-essentials: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    @storybook/addon-interactions: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    @storybook/react: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    @storybook/react-vite: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    @storybook/test: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    @storybook/test-runner: 0.19.2--canary.494.7268a7d.0 => 0.19.2--canary.494.7268a7d.0
    @storybook/types: ^8.2.0-alpha.10 => 8.2.0-alpha.10
    chromatic: ^11.4.0 => 11.4.0
    eslint-plugin-storybook: ^0.8.0 => 0.8.0
    storybook: ^8.2.0-alpha.10 => 8.2.0-alpha.10

Additional context

Using setupFiles instead works fine.

@IanVS IanVS added bug Something isn't working needs triage labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant