-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest-preset.js
55 lines (44 loc) · 1.45 KB
/
jest-preset.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
const path = require('path');
const resolve = path.resolve;
const join = path.join;
module.exports = {
collectCoverage: true,
coverageReporters: [
'lcov',
'text',
'clover'
],
watchPathIgnorePatterns: [
'node_modules'
],
clearMocks: true,
moduleFileExtensions: [
'js',
'ts'
],
moduleNameMapper: {
'\\.(css|less|scss)$': resolve(join(__dirname, '@tool/__mocks__/styleMock.js')),
'^src(.*)$': `${process.env.ADMIN_PATH}/src$1`,
// Quick fix to avoid mixing of es modules and umd on webpack builds
'^\@shopware-ag/admin-extension-sdk/es(.*)$': '\@shopware-ag/admin-extension-sdk/umd$1',
'^\@shopware-ag/meteor-admin-sdk/es(.*)$': '\@shopware-ag/meteor-admin-sdk/umd$1',
'^lodash-es$': 'lodash',
},
transform: {
'^.+\\.jsx?$': resolve(join(__dirname, '@tool/transform.js')),
'^.+\\.tsx?$': resolve(join(__dirname, '@tool/transform.js')),
'^.+(\\.twig|\\.html)$': resolve(join(__dirname, '@tool/twig-to-vue-transformer/index.js')),
},
modulePathIgnorePatterns: [
'<rootDir>/test/e2e/'
],
setupFilesAfterEnv: [
resolve(join(__dirname, '@tool/setup-env-require-context.js')),
resolve(join(__dirname, '@tool/setup-env-for-shopware.js')),
],
testMatch: [
'<rootDir>/src/**/*.spec.js',
'<rootDir>/src/**/*.spec.ts'
],
testEnvironment: 'jsdom',
};