Closed
Description
Describe the bug
Applying the following example code in a setupTests.ts file to setup project annotations for vitest:
import { beforeAll } from "vitest";
import { setProjectAnnotations } from "@storybook/react";
import { render as testingLibraryRender } from "@testing-library/react";
import * as storybookAnnotations from "./.storybook/preview";
const annotations = setProjectAnnotations([
storybookAnnotations,
{ testingLibraryRender },
]);
// ERROR
beforeAll(annotations.beforeAll);
annotations.beforeAll
is potentially undefined, although it is always a function, even if the user doesn’t define beforeAll
.
We should fix the type returned by setProjectAnnotations
to always set beforeAll
as required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Type
Projects
Status
Done