-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathjest.config.js
More file actions
32 lines (31 loc) · 1.02 KB
/
Copy pathjest.config.js
File metadata and controls
32 lines (31 loc) · 1.02 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
// Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
/** @type {import('jest').Config} */
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/tests/ts/setup.ts'],
testMatch: [
'<rootDir>/tests/ts/**/*.test.ts',
'<rootDir>/tests/ts/**/*.test.tsx'
],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tests/ts/tsconfig.json'
}
]
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
// tiktoken pulls in WebAssembly that doesn't load cleanly under jsdom.
// The tests don't depend on real tokenization, so stub it out.
moduleNameMapper: {
'^tiktoken$': '<rootDir>/tests/ts/__mocks__/tiktoken.ts',
'^strip-ansi$': '<rootDir>/tests/ts/__mocks__/strip-ansi.ts',
'\\.svg$': '<rootDir>/tests/ts/__mocks__/svg.ts',
'^@jupyterlab/apputils$':
'<rootDir>/tests/ts/__mocks__/jupyterlab-apputils.ts',
'^@jupyterlab/filebrowser$':
'<rootDir>/tests/ts/__mocks__/jupyterlab-filebrowser.ts'
},
clearMocks: true
};