-
Notifications
You must be signed in to change notification settings - Fork 9
/
jest.config.base.js
57 lines (53 loc) · 1.58 KB
/
jest.config.base.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
/**
* Copyright (c) 2019-2024 ForgeRock. All rights reserved.
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
const path = require('path');
process.env.VUE_APP_AM_URL = 'https://default.iam.example.com/am';
const babelTransform = path.join(__dirname, 'config', 'jest', 'babel-transform.js');
module.exports = {
moduleFileExtensions: [
'js',
'json',
'vue',
],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
globals: {
'vue-jest': {
transform: {
js: babelTransform,
},
},
},
transform: {
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\.js$': babelTransform,
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
},
transformIgnorePatterns: [
'node_modules/(?!(babel-jest|jest-vue-preprocessor|vee-validate/dist|vue-multiselect|@forgerock/ping-protect)/)',
],
moduleNameMapper: {
axios: '<rootDir>/../../__mocks__/axios.js',
'^@/(.*)$': '<rootDir>/src/$1',
'\\.(css)$': '<rootDir>/../../node_modules/jest-css-modules',
d3: '<rootDir>/../../node_modules/d3/dist/d3.min.js',
'^vue$': '@vue/compat',
},
testMatch: [
'**/*.test.js',
],
setupFiles: [
path.join(__dirname, 'config', 'jest', 'register-context.js'),
],
setupFilesAfterEnv: [
path.join(__dirname, 'config', 'jest', 'snapshot-errors.js'),
path.join(__dirname, 'config', 'jest', 'jest-dom.js'),
path.join(__dirname, 'config', 'jest', 'domrect-polyfill.js'),
],
};