-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
47 lines (43 loc) · 1.07 KB
/
jest.config.js
File metadata and controls
47 lines (43 loc) · 1.07 KB
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
const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');
// Provide a File implementation when Node.js doesn't expose it globally.
if (typeof File === 'undefined') {
try {
const { File: NodeFile } = require('node:buffer');
if (NodeFile) {
global.File = NodeFile;
}
} catch (error) {
try {
const { File: UndiciFile } = require('undici');
if (UndiciFile) {
global.File = UndiciFile;
}
} catch {
// ignore; @jupyterlab/testing will fail loudly if File remains undefined
}
}
}
const esModules = [
'@codemirror',
'@jupyter/ydoc',
'@jupyterlab/',
'lib0',
'nanoid',
'vscode-ws-jsonrpc',
'y-protocols',
'y-websocket',
'yjs'
].join('|');
const baseConfig = jestJupyterLab(__dirname);
module.exports = {
...baseConfig,
automock: false,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/.ipynb_checkpoints/*'
],
coverageReporters: ['lcov', 'text'],
testRegex: 'src/.*/.*.spec.ts[x]?$',
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
};