-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
63 lines (61 loc) · 1.83 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
52
53
54
55
56
57
58
59
60
61
62
63
// import { pathsToModuleNameMapper } from 'ts-jest';
// import compilerOptions from './tsconfig'
const esModules = ['uuid'].join('|');
export default (path, options) =>({
"verbose": true,
"rootDir": ".",
"moduleDirectories": [
"node_modules",
],
transformIgnorePatterns: [`<rootDir>\/(?!(/node_modules/(?!${esModules})))\/`],
// modulePaths: ["./packages/miroir-standalone-app/src/"], // <-- This will be set to 'baseUrl' value
modulePaths: ["./src/"], // <-- This will be set to 'baseUrl' value
// modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper:
// Object.assign(
{
// "^miroir-fwk(.*)$": "<rootDir>/src/$1",
// "^(.*)$": "$1",
'\\.(css|scss|sass)$': 'identity-obj-proxy',
}
// pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */)
// )
,
// resolver:options.defaultResolver(path, {...options}),
testEnvironment: "node",
moduleFileExtensions:[
"ts", "tsx", "js", "mjs", "cjs", "jsx", "json", "node"
],
// preset:'ts-jest/presets/default-esm',
"transform": {
"^.+\\.tsx?$": [
"ts-jest",
{
// useESM:true,
// tsconfig: "../../tsconfig.json"
tsconfig:
{
resolveJsonModule: true,
esModuleInterop: true,
allowSyntheticDefaultImports:true,
allowJs: true,
moduleResolution: "node",
// module: "ESNext",
// target: "ES2017",
// rootDir: "./src/",
traceResolution: true,
module:"commonjs"
},
}
],
"^.+\\.js?$": ["babel-jest"],
},
// moduleNameMapper: {
// "^miroir-fwk\/(.+)$": "<rootDir>/src/$1",
// '\\.(css|scss|sass)$': 'identity-obj-proxy',
// },
"testPathIgnorePatterns": [
"./node_modules/",
"./.cache/"
],
})