You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a couple of stories that use and components, and they work fine, passing the component tests when run through the Storybook webapp.
However, when I run the tests through the CLI I get the [Error: [nuxt] instance unavailable] and the components that need Nuxt do not render at all resulting in failing tests.
import { defineWorkspace } from "vitest/config";
import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin";
import path from "node:path";
import { fileURLToPath } from "node:url";
const dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
export default defineWorkspace([
// This is the path to your existing Vitest config file
"./vitest.config.ts",
{
// This is the path to your existing Vite config file
extends: "./vite.config.ts",
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: path.join(dirname, ".storybook"),
// This should match your package.json script to run Storybook
// The --ci flag will skip prompts and not open a browser
storybookScript: "yarn storybook --ci",
}),
],
test: {
name: "storybook",
// Enable browser mode
browser: {
enabled: true,
instances: [
{
browser: "chromium",
},
],
// Make sure to install Playwright
provider: "playwright",
headless: true,
},
setupFiles: ["./.storybook/vitest.setup.ts"],
},
},
]);
Describe the bug
I have a couple of stories that use and components, and they work fine, passing the component tests when run through the Storybook webapp.
However, when I run the tests through the CLI I get the
[Error: [nuxt] instance unavailable]
and the components that need Nuxt do not render at all resulting in failing tests.My config is:
main.ts:
vitest.setup.ts:
vitest.config.ts:
vitest.workspace.ts:
Reproduction link
http://example.com
Reproduction steps
No response
System
Additional context
No response
The text was updated successfully, but these errors were encountered: