-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjest.config.js
38 lines (36 loc) · 1.06 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
// Run all tests with timezone set to UTC
// https://stackoverflow.com/a/56482581
process.env.TZ = 'UTC';
// These are ES modules that we utilize that need to be transformed
// by babel when being imported during a jest test.
const esModules = ['@tinyhttp/content-disposition', 'sinon'].join('|');
module.exports = {
globals: {
LABKEY: {
contextPath: '',
defaultHeaders: {
'X-LABKEY-CSRF': 'TEST_CSRF_TOKEN',
},
},
},
moduleFileExtensions: ['ts', 'js'],
testEnvironment: 'jsdom',
testResultsProcessor: 'jest-teamcity-reporter',
testRegex: '(\\.(spec))\\.(ts)$',
transform: {
'\\.js$': [
'babel-jest',
{
configFile: './jest.babel.config.js',
},
],
'^.+\\.ts$': [
'ts-jest',
{
// This increases test perf by a considerable margin
isolatedModules: true,
},
],
},
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
};