-
Notifications
You must be signed in to change notification settings - Fork 22
/
jest.config.base.js
38 lines (34 loc) · 1.06 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
'use strict';
process.env.TZ = 'Europe/London';
process.env.LC_ALL = 'en_GB.UTF-8';
process.env.LANG = 'en_GB.UTF-8';
const path = require('path');
/** @typedef {import('ts-jest')} */
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
preset: 'ts-jest/presets/js-with-babel',
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost/'
},
setupFilesAfterEnv: [path.resolve(__dirname, '.jest', 'setupAfterEnv.js')],
moduleNameMapper: {
'\\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(__dirname, '.jest', 'mocks', 'file.js'),
'\\.(css|scss|sass|less)$': path.resolve(__dirname, '.jest', 'mocks', 'style.js')
},
moduleDirectories: [
'node_modules'
],
transform: {
"^.+\\.jsx?$": 'babel-jest',
"^.+\\.tsx?$": ['ts-jest', {
isolatedModules: true,
tsconfig: path.resolve(__dirname, 'tsconfig.jest.json'),
useESM: false
}]
},
transformIgnorePatterns: [
'node_modules/\.pnpm/(?!@)'
],
};
module.exports = config;