chore: install storybook
This commit is contained in:
@@ -1,32 +1,59 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
||||
import { playwright } from '@vitest/browser-playwright';
|
||||
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react({
|
||||
babel: {
|
||||
plugins: [["babel-plugin-react-compiler", {}]],
|
||||
},
|
||||
}),
|
||||
],
|
||||
plugins: [react({
|
||||
babel: {
|
||||
plugins: [["babel-plugin-react-compiler", {}]]
|
||||
}
|
||||
})],
|
||||
resolve: {
|
||||
alias: {
|
||||
shared: path.resolve(__dirname, "src/shared"),
|
||||
entities: path.resolve(__dirname, "src/entities"),
|
||||
features: path.resolve(__dirname, "src/features"),
|
||||
widgets: path.resolve(__dirname, "src/widgets"),
|
||||
app: path.resolve(__dirname, "src/app"),
|
||||
},
|
||||
app: path.resolve(__dirname, "src/app")
|
||||
}
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
setupFiles: ["./src/shared/config/test/setup.ts"],
|
||||
coverage: {
|
||||
provider: "v8",
|
||||
reporter: ["text", "json", "html"],
|
||||
exclude: ["node_modules/", "src/test/"],
|
||||
exclude: ["node_modules/", "src/test/"]
|
||||
},
|
||||
},
|
||||
});
|
||||
projects: [{
|
||||
extends: true,
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
setupFiles: ["./src/shared/config/test/setup.ts"]
|
||||
}
|
||||
}, {
|
||||
extends: true,
|
||||
plugins: [
|
||||
// The plugin will run tests for the stories defined in your Storybook config
|
||||
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
||||
storybookTest({
|
||||
configDir: path.join(dirname, '.storybook')
|
||||
})],
|
||||
test: {
|
||||
name: 'storybook',
|
||||
browser: {
|
||||
enabled: true,
|
||||
headless: true,
|
||||
provider: playwright({}),
|
||||
instances: [{
|
||||
browser: 'chromium'
|
||||
}]
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user