From 0661d68e22d3b2588e73ee01645bc3caaec09a47 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 25 Nov 2024 15:11:45 +0100 Subject: [PATCH] Refactor condition for Vitest standalone run check in preview.tsx --- code/addons/a11y/src/preview.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/addons/a11y/src/preview.tsx b/code/addons/a11y/src/preview.tsx index da554a9320e..9090ff6b915 100644 --- a/code/addons/a11y/src/preview.tsx +++ b/code/addons/a11y/src/preview.tsx @@ -9,9 +9,9 @@ import type { A11yParameters } from './params'; expect.extend(matchers); -// @ts-expect-error - ignore -// todo: check in webpack environments -const isVitestStandaloneRun = import.meta?.env?.STORYBOOK && import.meta?.env?.STORYBOOK !== 'true'; +const isVitestStandaloneRun = + // @ts-expect-error - ignore + !import.meta?.env?.STORYBOOK || import.meta?.env?.STORYBOOK !== 'true'; export const afterEach = async ({ reporting, parameters, globals, id }: StoryContext) => { const a11yParameter: A11yParameters | undefined = parameters.a11y;