forked from indico/indico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
79 lines (76 loc) · 1.96 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// This file is part of Indico.
// Copyright (C) 2002 - 2024 CERN
//
// Indico is free software; you can redistribute it and/or
// modify it under the terms of the MIT License; see the
// LICENSE file for more details.
/* eslint-env commonjs */
/* eslint-disable import/unambiguous, import/no-commonjs */
// When you get an error during `npm test` that's related to ES modules, list the package
// causing it in here; this makes sure jest applies babel transforms to those modules so
// it doesn't choke on (unsupported) `export` statements
const esModules = [
'geodesy',
'semantic-ui-react',
'uuid',
'nanoid',
'react-markdown',
'vfile',
'unist-.+',
'unified',
'bail',
'is-plain-obj',
'trough',
'remark-.+',
'mdast-util-.+',
'micromark',
'parse-entities',
'character-entities',
'property-information',
'comma-separated-tokens',
'hast-util-whitespace',
'remark-.+',
'space-separated-tokens',
'decode-named-character-reference',
'ccount',
'escape-string-regexp',
'markdown-table',
'trim-lines',
'axios',
].join('|');
module.exports = {
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
moduleNameMapper: {
'^.+\\.(s?css)$': 'identity-obj-proxy',
'^indico/modules/events/(reviewing|util)/(.*)$':
'<rootDir>/indico/modules/events/client/js/$1/$2',
'^indico/modules/events/([\\w]+)/(.*)$': '<rootDir>/indico/modules/events/$1/client/js/$2',
'^indico/modules/([\\w]+)/(.*)$': '<rootDir>/indico/modules/$1/client/js/$2',
'^indico/(.*)$': '<rootDir>/indico/web/client/js/$1',
},
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
globals: {
Indico: {
Urls: {
BasePath: '',
},
},
REACT_TRANSLATIONS: {
indico: {
'': {
domain: 'indico',
lang: 'en_GB',
},
},
},
TRANSLATIONS: {
indico: {
'': {
domain: 'indico',
lang: 'en_GB',
},
},
},
},
testEnvironment: 'jsdom',
};