-
Notifications
You must be signed in to change notification settings - Fork 50
/
vitest.config.mts
88 lines (86 loc) · 2.43 KB
/
vitest.config.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/// <reference types="vitest" />
import AllureReporter from 'allure-vitest/reporter';
import { defineConfig } from 'vitest/config';
import babel from 'vite-plugin-babel';
import { resolve as resolvePath } from 'path';
export default defineConfig({
plugins: [
babel({
babelConfig: {
presets: [
['@babel/preset-react', { throwIfNamespace: false }],
['@semcore/babel-preset-ui', { cssStyle: { extract: null } }],
],
plugins: ['babel-plugin-transform-import-meta'],
},
filter: /\.(j|t)sx?$/,
}),
],
resolve: {
alias: [
{
find: /^@semcore\/utils\/lib\/(.*)/,
replacement: resolvePath(__dirname, 'semcore/utils/src/$1'),
},
{
find: /^@semcore\/icon\/(.*)/,
replacement: resolvePath(__dirname, 'semcore/icon/$1'),
},
{
find: /^@semcore\/esbuild-plugin-semcore\/(.*)/,
replacement: resolvePath(__dirname, 'tools/esbuild-plugin-semcore/$1'),
},
{
find: /^@semcore\/testing-utils\/(.*)/,
replacement: resolvePath(__dirname, 'tools/testing-utils/$1'),
},
{
find: /^@semcore\/([\w-]*)$/,
replacement: resolvePath(__dirname, 'semcore/$1/src'),
},
{
find: /^intergalactic\/([\w-]*)$/,
replacement: resolvePath(__dirname, 'semcore/$1/src'),
},
],
},
test: {
testTimeout: 60 * 1000,
include: [
'semcore/*/__tests__/**/*.test.tsx',
'semcore/*/__tests__/**/*.test.jsx',
'semcore/*/__tests__/**/*.test.ts',
'semcore/*/__tests__/**/*.test.js',
'tools/*/__tests__/**/*.test.tsx',
'tools/*/__tests__/**/*.test.jsx',
'tools/*/__tests__/**/*.test.ts',
'tools/*/__tests__/**/*.test.js',
],
exclude: [
'tools/icon-transform-svg',
'**/*.d.ts',
'node_modules',
'dist',
'.idea',
'.git',
'.cache',
'tools/*/__tests__/utils.ts'
],
environment: 'jsdom',
setupFiles: ['allure-vitest/setup', resolvePath(__dirname, 'tools/testing-utils/setupTests')],
reporters: ["default", new AllureReporter({})],
},
define: {
'globalThis.__intergalacticFlagsBaseUrl': '"https://static.semrush.com/ui-kit/flags/"',
},
});
declare global {
namespace jest {
interface Matchers<R> {
toMatchImageSnapshot(task: any, options: any): R;
toHaveNoViolations(): R;
toHaveFocus(): R;
toHaveStyle(style: string): R;
}
}
}