forked from TanStack/table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
76 lines (71 loc) · 1.98 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
const path = require('path')
const { lstatSync, readdirSync } = require('fs')
// get listing of packages in the mono repo
const basePath = path.resolve(__dirname, 'packages')
const packages = readdirSync(basePath).filter(name => {
return lstatSync(path.join(basePath, name)).isDirectory()
})
const { namespace } = require('./package.json')
const moduleNameMapper = {
...packages.reduce(
(acc, name) => ({
...acc,
[`${namespace}/${name}(.*)$`]: `<rootDir>/packages/./${name}/src/$1`,
}),
{}
),
}
module.exports = {
projects: [
{
displayName: 'table-core',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/packages/table-core/**/*.test.[jt]s?(x)'],
setupFilesAfterEnv: [
'<rootDir>/packages/table-core/__tests__/jest.setup.js',
],
snapshotFormat: {
printBasicPrototype: false,
},
moduleNameMapper,
},
{
displayName: 'react-table',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/packages/react-table/**/*.test.[jt]s?(x)'],
setupFilesAfterEnv: [
'<rootDir>/packages/react-table/__tests__/jest.setup.js',
],
snapshotFormat: {
printBasicPrototype: false,
},
moduleNameMapper,
},
{
displayName: 'react-table-devtools',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/packages/react-table-devtools/**/*.test.[jt]s?(x)',
],
setupFilesAfterEnv: [
'<rootDir>/packages/react-table-devtools/__tests__/jest.setup.js',
],
snapshotFormat: {
printBasicPrototype: false,
},
moduleNameMapper,
},
{
displayName: 'match-sorter-utils',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/packages/match-sorter-utils/**/*.test.[jt]s?(x)'],
setupFilesAfterEnv: [
'<rootDir>/packages/match-sorter-utils/__tests__/jest.setup.js',
],
snapshotFormat: {
printBasicPrototype: false,
},
moduleNameMapper,
},
],
}