forked from omegaup/omegaup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
57 lines (56 loc) · 1.47 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
const babelConfig = {
presets: [
[
'@babel/preset-env',
{
corejs: 3,
modules: false,
useBuiltIns: 'entry',
targets: {
esmodules: false,
node: 'current',
},
},
],
],
plugins: [
'@babel/plugin-transform-async-to-generator',
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-proposal-class-properties',
['@babel/plugin-transform-typescript', { allowNamespaces: true }],
],
};
module.exports = {
testEnvironment: 'jsdom',
moduleFileExtensions: ['js', 'ts', 'vue'],
moduleDirectories: ['node_modules'],
moduleNameMapper: {
'vue-async-computed-decorator':
'<rootDir>/node_modules/vue-async-computed-decorator/dist/index.js',
'^@/(.*)$': '<rootDir>/frontend/www/$1',
'\\.(css|less)$':
'<rootDir>/frontend/www/js/omegaup/__mocks__/styleMock.js',
'monaco-editor':
'<rootDir>/frontend/www/third_party/js/__mocks__/monacoEditor.js',
sugar: '<rootDir>/frontend/www/js/omegaup/__mocks__/sugar.js',
},
setupFilesAfterEnv: ['<rootDir>/frontend/www/js/omegaup/test.setup.ts'],
globals: {
'vue-jest': {
babelConfig,
},
},
transform: {
'.*\\.vue$': [
'vue-jest',
{
babelConfig,
},
],
'.*\\.[jt]sx?$': ['babel-jest', babelConfig],
},
transformIgnorePatterns: [
'node_modules/(?!(vue-.*|@voerro/vue-tagsinput|monaco-editor|monaco-editor-core)/)',
],
testURL: 'http://localhost:8001/',
};