Skip to content

Commit

Permalink
[FIX] config: Feed dedicated tsconfig.json file to jest
Browse files Browse the repository at this point in the history
Since 457fe70, we changed stopped compiling the `.ts` files in the
`tests` folders to save compilation time. Unfortunately, jest was using
the very same file to compile (via `ts-jest`) and it actually needs to
compile `tests/setup/jest.setup.ts` to work properly.

This commit introduces a new dedicated `tsconfig` file for ts-jest in
order to retain the improvements of 457fe70.

closes #1317

Signed-off-by: Pierre Rousseau (pro) <[email protected]>
  • Loading branch information
rrahir committed Apr 29, 2022
1 parent 47d6a54 commit 09863df
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@
],
"setupFilesAfterEnv": [
"<rootDir>/tests/setup/jest.setup.ts"
]
],
"globals": {
"ts-jest": {
"tsconfig": "tsconfig.jest.json"
}
}
},
"lint-staged": {
"{src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,demo/*.js}": "prettier --write"
Expand Down
32 changes: 32 additions & 0 deletions tsconfig.jest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"module": "commonjs",
"preserveConstEnums": true,
"noImplicitThis": true,
"moduleResolution": "node",
"removeComments": false,
"target": "es2019",
"outDir": "dist",
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"strictPropertyInitialization": true,
"strictNullChecks": true,
"esModuleInterop": true,
"allowJs": true,
"sourceMap": true
},
"include": ["src", "tests"],
"typedocOptions": {
"entryPoints": ["src/index.ts"],
"out": "doc/tsdoc",
"name": "o-spreadsheet API",
"readme": "none",
"excludePrivate": true,
"hideGenerator": true,
"disableSources": true,
"excludeExternals": true
}
}

0 comments on commit 09863df

Please sign in to comment.