-
Notifications
You must be signed in to change notification settings - Fork 145
/
vitest.config.mts
83 lines (80 loc) · 3.7 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
import path from 'path';
import svgr from 'vite-plugin-svgr';
import { defineConfig } from 'vitest/config';
const resolve = (src: string) => {
return path.resolve(__dirname, src);
};
const isDist = process.env.LIB_DIR === 'dist';
export default defineConfig({
plugins: [
svgr({
svgrOptions: {
exportType: 'default',
},
include: ['**/*.svg'],
}),
],
resolve: {
alias: isDist
? {
'@ant-design/web3': resolve('./packages/web3/dist/esm/index'),
'@ant-design/web3-icons': resolve('./packages/icons/dist/esm/index'),
'@ant-design/web3-assets/solana': resolve('./packages/assets/dist/esm/solana/index'),
'@ant-design/web3-assets/tokens': resolve('./packages/assets/dist/esm/tokens/index'),
'@ant-design/web3-assets/wallets': resolve('./packages/assets/dist/esm/wallets/index'),
'@ant-design/web3-assets': resolve('./packages/assets/dist/esm/index'),
'@ant-design/web3-wagmi': resolve('./packages/wagmi/dist/esm/index'),
'@ant-design/web3-ethers-v5': resolve('./packages/ethers-v5/dist/esm/index'),
'@ant-design/web3-ethers': resolve('./packages/ethers/dist/esm/index'),
'@ant-design/web3-ethers/provider': resolve(
'./packages/ethers/dist/esm/ethers-provider/index',
),
'@ant-design/web3-ethers/wallets': resolve('./packages/ethers/dist/esm/wallets/index'),
'@ant-design/web3-solana': resolve('./packages/solana/dist/esm/index'),
'@ant-design/web3-sui': resolve('./packages/sui/dist/esm/index'),
'@ant-design/web3-ton': resolve('./packages/ton/dist/esm/index'),
'@ant-design/web3-eth-web3js': resolve('./packages/eth-web3js/dist/esm/index'),
'@ant-design/web3-common': resolve('./packages/common/dist/esm/index'),
}
: {
'@ant-design/web3': resolve('./packages/web3/src/index'),
'@ant-design/web3-icons': resolve('./packages/icons/src/index'),
'@ant-design/web3-assets/solana': resolve('./packages/assets/src/solana/index'),
'@ant-design/web3-assets/tokens': resolve('./packages/assets/src/tokens/index'),
'@ant-design/web3-assets/wallets': resolve('./packages/assets/src/wallets/index'),
'@ant-design/web3-assets': resolve('./packages/assets/src/index'),
'@ant-design/web3-wagmi': resolve('./packages/wagmi/src/index'),
'@ant-design/web3-ethers-v5': resolve('./packages/ethers-v5/src/index'),
'@ant-design/web3-ethers': resolve('./packages/ethers/src/index'),
'@ant-design/web3-ethers/provider': resolve(
'./packages/ethers/src/ethers-provider/index',
),
'@ant-design/web3-ethers/wallets': resolve('./packages/ethers/src/wallets/index'),
'@ant-design/web3-solana': resolve('./packages/solana/src/index'),
'@ant-design/web3-sui': resolve('./packages/sui/src/index'),
'@ant-design/web3-ton': resolve('./packages/ton/src/index'),
'@ant-design/web3-eth-web3js': resolve('./packages/eth-web3js/src/index'),
'@ant-design/web3-common': resolve('./packages/common/src/index'),
},
},
test: {
environment: 'jsdom',
include: ['./packages/**/*.test.{ts,tsx}'],
setupFiles: ['./tests/setup.ts'],
reporters: ['default'],
coverage: {
include: ['packages/*/src/**/*.{ts,tsx}'],
exclude: [
'**/demos/**/*.{ts,tsx}',
'**/src/index.ts',
'**/__tests__/*.{ts,tsx}',
'**/*.test.{ts,tsx}',
],
reporter: ['json-summary', ['text', { skipFull: true }], 'cobertura', 'html'],
},
testTimeout: 3e4,
alias: {
'copy-to-clipboard': resolve('./tests/copy-to-clipboard'),
},
},
});