-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
56 lines (50 loc) · 1.32 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
var tsConfig = require('./tsconfig.json');
var tsOptions = tsConfig['compilerOptions'];
// Need as the __mocks__ folder is not visible from the src folder
tsOptions['rootDir'] = null;
tsOptions['inlineSourceMap'] = true;
const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');
const esModules = [
'@jupyterlab/',
'@jupyter/ydoc',
'lib0',
'y\\-protocols',
'y\\-websocket',
'yjs'
].join('|');
const jlabConfig = jestJupyterLab(__dirname);
const {
moduleFileExtensions,
moduleNameMapper,
preset,
setupFilesAfterEnv,
setupFiles,
testPathIgnorePatterns,
transform
} = jlabConfig;
module.exports = {
moduleFileExtensions,
moduleNameMapper,
preset,
setupFilesAfterEnv,
setupFiles: [...setupFiles, '<rootDir>/testutils/jest-setup-files.js'],
testPathIgnorePatterns,
modulePathIgnorePatterns: ['<rootDir>/build', '<rootDir>/jupyterlab_daw'],
transform,
unmockedModulePathPatterns: ['<rootDir/node_modules/tone'],
automock: false,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/.ipynb_checkpoints/*'
],
coverageDirectory: 'coverage',
coverageReporters: ['lcov', 'text'],
globals: {
'ts-jest': {
tsconfig: tsOptions
}
},
testRegex: 'src/.*/.*.spec.ts[x]?$',
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
};