From 5affbc24b945e6edc2b0ae0a8a2999e574565b6d Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Wed, 8 Jan 2025 15:02:25 +0100 Subject: [PATCH] Adjust sandbox parts to setup addon test the same way as its postinstall script --- scripts/tasks/sandbox-parts.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 271fbba9dcd8..5d11bd7380ed 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -480,13 +480,22 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio dedent` import { defineWorkspace, defaultExclude } from "vitest/config"; import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin"; + import path from 'node:path'; + import { fileURLToPath } from 'node:url'; + + import viteConfig from './vite.config'; + ${frameworkPluginImport} + const dirname = + typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); + export default defineWorkspace([ { ${!isNextjs ? `extends: "${viteConfigPath}",` : ''} plugins: [ storybookTest({ + configDir: path.join(dirname, '.storybook'), storybookScript: "yarn storybook --ci", tags: { include: ["vitest"],