Files
standardnotes-app-web/app/assets/javascripts/jest.config.js
Karol Sójko 2d3221c944 fix: running tests and adding tests to CI & CD (#1047)
* fix: running tests and adding tests to CI & CD

* fix: yarn.lock

* fix: alert service

* fix: ts-jest utils import
2022-05-24 11:06:17 +02:00

37 lines
876 B
JavaScript

const pathsToModuleNameMapper = require('ts-jest/utils').pathsToModuleNameMapper
const tsConfig = require('./tsconfig.json')
const pathsFromTsconfig = tsConfig.compilerOptions.paths
module.exports = {
restoreMocks: true,
clearMocks: true,
resetMocks: true,
moduleNameMapper: {
...pathsToModuleNameMapper(pathsFromTsconfig, {
prefix: '<rootDir>',
}),
'^react$': ['preact/compat'],
'^react-dom$': 'preact',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
globals: {
__VERSION__: '1.0.0',
__DESKTOP__: false,
__WEB__: true,
self: {}, // fixes error happening on `import { SKAlert } from 'sn-stylekit'`
},
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
'\\.svg$': 'svg-jest',
},
coverageThreshold: {
global: {
branches: 3,
functions: 5,
lines: 21,
statements: 22,
},
},
}