forked from jupyterlab/jupyterlab-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
44 lines (41 loc) · 1.07 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
var tsConfig = require('./tsconfig.json');
var tsOptions = tsConfig['compilerOptions'];
// Need as the test folder is not visible from the src folder
tsOptions['rootDir'] = null;
tsOptions['inlineSourceMap'] = true;
const esModules = [
'.*@jupyterlab/',
'@jupyter/ydoc',
'lib0',
'y\\-protocols',
'y\\-websocket',
'yjs'
].join('|');
module.exports = {
automock: false,
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(svg)$': '<rootDir>/testutils/jest-file-mock.js'
},
preset: 'ts-jest/presets/js-with-babel',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePathIgnorePatterns: [
'<rootDir>/build',
'<rootDir>/jupyterlab_git',
'<rootDir>/jupyter-config'
],
setupFiles: ['<rootDir>/testutils/jest-setup-files.js'],
testPathIgnorePatterns: [
'/lib/',
'/node_modules/',
'/jupyterlab_git/',
'/ui-tests/'
],
testRegex: '/tests/.*.spec.ts[x]?$',
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`],
globals: {
'ts-jest': {
tsconfig: tsOptions
}
}
};