forked from jaikme/pos-mamba-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
51 lines (50 loc) · 1.4 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
const { resolve } = require('path');
const getSvelteModuleMaps = require('./packages/configs/jest/getSvelteModuleMaps.js');
module.exports = {
rootDir: process.cwd(),
collectCoverage: true,
collectCoverageFrom: [
'**/*.{html,htmlx,svelte}',
'packages/utils/**/*.js',
'!**/node_modules/**',
'!tools/**',
'!packages/pos/**',
'!packages/**/example/**',
],
coverageThreshold: {
'**/*.html': {
branches: 0,
},
},
testMatch: ['**/*.test.js'],
setupFiles: [
'<rootDir>/tools/jest/setup/simulator.js',
'<rootDir>/tools/jest/setup/globals.js',
'@mamba/configs/jest/globals.js',
'jest-canvas-mock',
],
moduleFileExtensions: ['js'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|svg|ttf)$': '<rootDir>/tools/jest/mocks/fileMock.js',
/** act as a resolver for the "svelte" field of a component package.json */
...getSvelteModuleMaps(resolve(__dirname, 'packages', 'components')),
},
transformIgnorePatterns: [
'node_modules/(?!(@mamba)|(.+\\.html)|(svelte.+\\.js))',
],
transform: {
'^.+\\.js$': '<rootDir>/tools/jest/babelPreprocess.js',
'^.+\\.(htmlx?|svelte)$': '<rootDir>/tools/jest/svelteTransformer.js',
},
globals: {
__NODE_ENV__: 'test',
__APP_ENV__: 'browser',
__PROD__: false,
__TEST__: true,
__DEV__: true,
__DEBUG_LVL__: null,
__POS__: false,
__SIMULATOR__: true,
__BROWSER__: true,
},
};