mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Share the same tsconfig by adding overrides in new jest config
This commit is contained in:
parent
ecd3a218aa
commit
8030143ace
4 changed files with 28 additions and 51 deletions
27
jest.config.js
Normal file
27
jest.config.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
const tsConfig = require('./tsconfig');
|
||||
|
||||
module.exports = {
|
||||
preset: "ts-jest",
|
||||
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
globals: {
|
||||
"ts-jest": {
|
||||
tsConfig: {
|
||||
...tsConfig.compilerOptions,
|
||||
types: ["jest", "node"]
|
||||
},
|
||||
diagnostics: {
|
||||
ignoreCodes: [151001]
|
||||
},
|
||||
}
|
||||
},
|
||||
moduleNameMapper: {
|
||||
"@src/(.*)": "<rootDir>/src/$1"
|
||||
},
|
||||
moduleFileExtensions: [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json"
|
||||
],
|
||||
};
|
24
package.json
24
package.json
|
@ -58,30 +58,6 @@
|
|||
"lint": "bash hooks/pre-commit",
|
||||
"pretty": "bash scripts/pretty.sh"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"@src/(.*)": "<rootDir>/src/$1"
|
||||
},
|
||||
"globals": {
|
||||
"ts-jest": {
|
||||
"tsConfig": "tsconfig.test.json",
|
||||
"diagnostics": {
|
||||
"ignoreCodes": [
|
||||
151001
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"author": "Colin Caine",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"outDir": "build/tsc-out",
|
||||
"sourceMap": true,
|
||||
"target": "es2017",
|
||||
"lib": ["es2017","es2019.array","dom", "dom.iterable"],
|
||||
"lib": ["es2017","es2019.array", "es2018.promise", "dom", "dom.iterable"],
|
||||
"types": ["web-ext-types"],
|
||||
"experimentalDecorators": true,
|
||||
"alwaysStrict": true,
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"moduleResolution": "node",
|
||||
"noImplicitAny": false,
|
||||
"noEmitOnError": true,
|
||||
"outDir": "build/tsc-out",
|
||||
"sourceMap": true,
|
||||
"target": "es2017",
|
||||
"lib": ["es2017", "es2019.array", "es2018.promise", "dom", "dom.iterable"],
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"types": ["jest", "node"],
|
||||
"experimentalDecorators": true,
|
||||
"alwaysStrict": true,
|
||||
"baseUrl": "src/",
|
||||
"paths": {
|
||||
"@src/*": ["*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"./src/**/*.test.ts"
|
||||
]
|
||||
}
|
Loading…
Add table
Reference in a new issue