parent
8aa5e72dab
commit
13d10c7f5f
@ -1,20 +1,29 @@ |
|||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// jest.config.js
|
||||||
const path = require("path"); |
const path = require("path"); |
||||||
const monorepoRoot = path.resolve(__dirname); |
const monorepoRoot = path.resolve(__dirname); |
||||||
|
|
||||||
module.exports = { |
module.exports = { |
||||||
preset: "ts-jest/presets/default-esm", |
preset: "ts-jest/presets/js-with-ts", |
||||||
extensionsToTreatAsEsm: [".ts"], |
testEnvironment: "node", |
||||||
moduleNameMapper: { |
moduleNameMapper: { |
||||||
"^(\\.{1,2}/.*)\\.js$": "$1", |
"^(\\.{1,2}/.*)\\.js$": "$1", |
||||||
[`^@ldo/(.*)$`]: `${monorepoRoot}/packages/$1/src/index.ts`, |
"^@ldo/(.*)$": `${monorepoRoot}/packages/$1/src/index.ts`, |
||||||
}, |
}, |
||||||
testEnvironment: "node", |
|
||||||
coveragePathIgnorePatterns: [ |
coveragePathIgnorePatterns: [ |
||||||
"/node_modules/", |
"/node_modules/", |
||||||
"/dist/", |
"/dist/", |
||||||
"/coverage/", |
"/coverage/", |
||||||
"/test/", |
"/test/", |
||||||
], |
], |
||||||
globals: {}, |
transform: { |
||||||
|
"^.+\\.ts$": [ |
||||||
|
"ts-jest", |
||||||
|
{ |
||||||
|
tsconfig: "<rootDir>/tsconfig.cjs.json", |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
testPathIgnorePatterns: ["/node_modules/", "/dist/"], |
||||||
|
transformIgnorePatterns: ["/node_modules/", "/dist/"], |
||||||
|
modulePathIgnorePatterns: ["/dist/"], |
||||||
}; |
}; |
||||||
|
@ -1,9 +1,10 @@ |
|||||||
{ |
{ |
||||||
"extends": "../../tsconfig.base.json", |
"extends": "../../tsconfig.cjs.json", |
||||||
"compilerOptions": { |
"compilerOptions": { |
||||||
"outDir": "./dist/cjs" |
"outDir": "./dist/cjs", |
||||||
|
"rootDir": "./src" |
||||||
}, |
}, |
||||||
"include": [ |
"include": [ |
||||||
"./src" |
"src" |
||||||
] |
] |
||||||
} |
} |
@ -1,9 +1,11 @@ |
|||||||
{ |
{ |
||||||
"extends": "../../tsconfig.base.json", |
"extends": "../../tsconfig.esm.json", |
||||||
"compilerOptions": { |
"compilerOptions": { |
||||||
"outDir": "./dist/esm" |
"outDir": "./dist/esm", |
||||||
|
"rootDir": "./src", |
||||||
|
"declarationDir": "./dist/types" |
||||||
}, |
}, |
||||||
"include": [ |
"include": [ |
||||||
"./src" |
"src" |
||||||
] |
] |
||||||
} |
} |
@ -1,9 +1,10 @@ |
|||||||
{ |
{ |
||||||
"extends": "../../tsconfig.cjs.json", |
"extends": "../../tsconfig.cjs.json", |
||||||
"compilerOptions": { |
"compilerOptions": { |
||||||
"outDir": "./dist/cjs" |
"outDir": "./dist/cjs", |
||||||
|
"rootDir": "./src" |
||||||
}, |
}, |
||||||
"include": [ |
"include": [ |
||||||
"./src" |
"src" |
||||||
] |
] |
||||||
} |
} |
@ -1,9 +1,11 @@ |
|||||||
{ |
{ |
||||||
"extends": "../../tsconfig.esm.json", |
"extends": "../../tsconfig.esm.json", |
||||||
"compilerOptions": { |
"compilerOptions": { |
||||||
"outDir": "./dist/esm" |
"outDir": "./dist/esm", |
||||||
|
"rootDir": "./src", |
||||||
|
"declarationDir": "./dist/types" |
||||||
}, |
}, |
||||||
"include": [ |
"include": [ |
||||||
"./src" |
"src" |
||||||
] |
] |
||||||
} |
} |
@ -1,27 +1,28 @@ |
|||||||
{ |
{ |
||||||
"compilerOptions": { |
"compilerOptions": { |
||||||
|
"target": "ES2021", |
||||||
"module": "commonjs", |
"module": "commonjs", |
||||||
"baseUrl": ".", |
|
||||||
"strict": true, |
|
||||||
"esModuleInterop": true, |
|
||||||
"noImplicitAny": false, |
|
||||||
"removeComments": true, |
|
||||||
"lib": [ |
"lib": [ |
||||||
"ES2021" |
"ES2021" |
||||||
], |
], |
||||||
|
"strict": true, |
||||||
|
"esModuleInterop": true, |
||||||
|
"moduleResolution": "node", |
||||||
|
"declaration": true, |
||||||
|
"declarationMap": true, |
||||||
|
"sourceMap": true, |
||||||
"emitDecoratorMetadata": true, |
"emitDecoratorMetadata": true, |
||||||
"experimentalDecorators": true, |
"experimentalDecorators": true, |
||||||
"target": "ES2021", |
|
||||||
"sourceMap": true, |
|
||||||
"jsx": "react-jsx", |
|
||||||
"noErrorTruncation": true, |
|
||||||
"forceConsistentCasingInFileNames": true, |
"forceConsistentCasingInFileNames": true, |
||||||
"noEmit": false |
"noImplicitAny": false, |
||||||
|
"skipLibCheck": true, |
||||||
|
"jsx": "react-jsx" |
||||||
}, |
}, |
||||||
"exclude": [ |
"exclude": [ |
||||||
"node_modules", |
"node_modules", |
||||||
"**/*.spec.ts", |
|
||||||
"**/dist", |
"**/dist", |
||||||
"**/coverage" |
"**/coverage", |
||||||
|
"**/*.test.ts", |
||||||
|
"**/*.spec.ts" |
||||||
] |
] |
||||||
} |
} |
Loading…
Reference in new issue