-
Notifications
You must be signed in to change notification settings - Fork 5
/
jest.config.js
80 lines (74 loc) · 2.27 KB
/
jest.config.js
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
const path = require('path')
const fs = require('fs')
const buffer = fs.readFileSync(path.join(__dirname, 'lerna.json'))
const { packages: packageRoots } = JSON.parse(buffer.toString())
const repoPackages = packageRoots.flatMap((root) => {
const directory = path.dirname(root)
return fs
.readdirSync(path.join(__dirname, directory))
.filter((it) => !it.startsWith('.'))
.map((folder) => `@exodus/${folder}`)
})
const untranspiledModulePatterns = [
...repoPackages,
'react-native',
'@exodus/solana-*',
'@exodus/core-selectors',
'@exodus/ethereum-*',
'@exodus/bitcoin-*',
'@exodus/dogecoin-*',
'@noble/*',
'@exodus/argo',
'@exodus/find-optimistic-orders',
'@exodus/ethersproject-*',
'@exodus/algorand-*',
'@exodus/cardano-*',
'@exodus/cosmos-*',
'@exodus/cosmjs-fork',
'@exodus/dependency-injection',
'@exodus/dependency-preprocessors',
'@exodus/osmosis-*',
'@exodus/key-utils',
'@exodus/slip10',
'@exodus/module',
'@exodus/atoms',
'@exodus/storage-memory',
'@exodus/basic-utils',
'@exodus/timer',
'@exodus/serialization',
'@exodus/solidity-contract',
'@exodus/web3-solana-utils',
'@exodus/feature-control',
'@exodus/nfts-proxy',
'@exodus/key-ids',
'@exodus/wild-emitter',
'@exodus/solidity-contract',
'@exodus/fiat-client',
'ethereum-cryptography',
'p-defer',
'p-debounce', // TODO: remove me after updating basic-utils
'p-event',
'p-timeout',
'delay',
]
/** @type {import('@jest/types').Config.InitialOptions} */
const CI_CONFIG = {
reporters: ['summary', 'github-actions'],
coverageReporters: ['json-summary', 'text-summary', 'json'],
}
/** @type {import('@jest/types').Config.InitialOptions} */
const DEV_CONFIG = {
coverageReporters: ['json-summary', 'text-summary', 'lcov', 'json'],
}
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
transformIgnorePatterns: [`node_modules/(?!((jest-)?${untranspiledModulePatterns.join('|')}))`],
// https://jestjs.io/docs/en/configuration#testmatch-array-string
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
setupFilesAfterEnv: [path.join(__dirname, 'jest.setup.js')],
collectCoverage: true,
testTimeout: 10_000,
bail: true,
forceExit: true,
...(process.env.CI === 'true' ? CI_CONFIG : DEV_CONFIG),
}