- Issue
Suppose that we have following directory structure.
project
|- config
|- jest.config.js
|- tsconfig.base.json
|- tsconfig.dev.json
|- tsconfig.test.json
|- test
|- test1.ts
|- tsconfig.json
| - tsconfig.json
And also suppose that tsconfig.dev.json and tsconfig.test.json extend ./tsconfig.base.json, jest.config.js have following content.
module.exports = {
errorOnDeprecated: true,
globals: {
'ts-jest': {
tsConfigFile: './config/tsconfig.test.json',
},
},
moduleFileExtensions: [
'js', 'jsx', 'json', 'ts', 'tsx',
],
rootDir: '../',
testMatch: [
'<rootDir>/test/**/*.ts',
],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
};
For this case, running tsc -p config/tsconfig.dev.json in project directory works well, but jest --config=./config/jest.config.js does not work with error
Some errors occurred while attempting to read from <project directory>/config/tsconfig.test.json: error TS5058: The specified path does not exist: '<project directory>/tsconfig.base.json'.
IMO, this problem probably came from following line,
which is changed in
e5ad58e
tsconfig.test.json reads <project directory>/config/tsconfig.base.json
-
Output from your debug log
I tried test with TS_JEST_DEBUG="true", but debug.txt file does not generated.
-
Link to a minimal repo that reproduces this issue
-
Optional (but highly recommended) - Configure Travis (or your favorite system) with the minimal repo
This allows potential solutions to be tested against the minimal repo. This saves everyone time and avoids a lot of back and forth.
Suppose that we have following directory structure.
And also suppose that
tsconfig.dev.jsonandtsconfig.test.jsonextend./tsconfig.base.json,jest.config.jshave following content.For this case, running
tsc -p config/tsconfig.dev.jsoninprojectdirectory works well, butjest --config=./config/jest.config.jsdoes not work with errorIMO, this problem probably came from following line,
ts-jest/src/utils.ts
Line 37 in 6741e63
which is changed in e5ad58e
tsconfig.test.jsonreads<project directory>/config/tsconfig.base.jsonOutput from your debug log
I tried test with
TS_JEST_DEBUG="true", butdebug.txtfile does not generated.Link to a minimal repo that reproduces this issue
Optional (but highly recommended) - Configure Travis (or your favorite system) with the minimal repo
This allows potential solutions to be tested against the minimal repo. This saves everyone time and avoids a lot of back and forth.