Skip to content

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

Open
@IanVS

Description

@IanVS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions