mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 16:26:58 +08:00
test: support e2e in storybook (#1533)
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
import { mergeConfig } from 'vite';
|
||||
import path from 'node:path';
|
||||
import { resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import istanbul from 'vite-plugin-istanbul';
|
||||
|
||||
const config: Pick<StorybookConfig, 'viteFinal'> = {
|
||||
async viteFinal(config, { configType }) {
|
||||
return mergeConfig(config, {
|
||||
plugins: [
|
||||
istanbul({
|
||||
include: ['src/*'],
|
||||
exclude: ['node_modules', 'test', 'stories'],
|
||||
extension: ['.ts', '.tsx'],
|
||||
forceBuildInstrument: process.env.COVERAGE === 'true',
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(fileURLToPath(new URL('../src', import.meta.url))),
|
||||
'@affine/i18n': path.resolve(
|
||||
'@': resolve(fileURLToPath(new URL('../src', import.meta.url))),
|
||||
'@affine/i18n': resolve(
|
||||
fileURLToPath(new URL('../../i18n/src', import.meta.url))
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user