Files
Vinicius LourençoandGitHub 9518b912f1 feat(storybook): bump version of storybook to v10 (#127)
* feat(storybook): bump version of storybook to v10

* test(storybook): add ci step

* chore(build): target es2018 & from .js to .mjs

* chore(.idea): do not track this folder

* fix(storybook): not injecting the css on build
2026-02-27 21:54:14 +05:30

50 lines
1.3 KiB
TypeScript

import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
import { playwright } from '@vitest/browser-playwright';
import { defineConfig, mergeConfig } from 'vitest/config';
import viteConfig from './vite.config.js';
const dirname = path.dirname(fileURLToPath(import.meta.url));
export default mergeConfig(
viteConfig,
defineConfig({
test: {
projects: [
{
extends: true,
plugins: [
storybookTest({
configDir: path.join(dirname, '.storybook'),
storybookScript: 'pnpm dev --no-open',
}),
],
test: {
name: 'storybook',
browser: {
enabled: true,
provider: playwright({}),
headless: true,
instances: [{ browser: 'chromium' }],
},
setupFiles: ['./.storybook/vitest.setup.ts'],
onUnhandledError(
error: (Error | { message?: string; name?: string }) & { type: string }
) {
if (
error.name === 'SecurityError' &&
typeof error.message === 'string' &&
error.message.includes('Blocked a frame with origin') &&
error.message.includes('from accessing a cross-origin frame')
) {
return false;
}
},
},
},
],
},
})
);