TypeScript Version:4.1.3
ts-jest Version:26.4.4
Code
tsconfig.json
{
"compilerOptions": {
"sourceMap": false,
"module": "commonjs",
"noImplicitAny": true,
"removeComments": false,
"moduleResolution":"node",
"baseUrl": ".",
"target": "es6",
"outDir": "./lib",
"declaration": true,
"strict": true,
},
"include": ["src"],
"exclude": ["node_modules","tests"]
}
jest.config.js
module.exports = {
roots: ['<rootDir>/tests'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
transform: {
'^.+\\.ts?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testEnvironment: 'node',
collectCoverageFrom: ['<rootDir>/src/**/*'],
coveragePathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/tests'],
verbose: true,
};
When I run tsc, it is ok. But if I run jest to test,it is failed.
Expected behavior:
Avoid and exclude tests ts files.
Actual behavior:
It check ts files in the tests folder which has been excluded.
Workaround:
But if a restart VS then i will see the same behavior.
error:
● Test suite failed to run
tests/tag2.test.ts:5:22 - error TS7006: Parameter 'state' implicitly has an 'any' type.
Here is my project:
https://github.com/changchangge/simple-redux/tree/tag2
I hope that someone can help me , thanks!
TypeScript Version:4.1.3
ts-jest Version:26.4.4
Code
tsconfig.json
{ "compilerOptions": { "sourceMap": false, "module": "commonjs", "noImplicitAny": true, "removeComments": false, "moduleResolution":"node", "baseUrl": ".", "target": "es6", "outDir": "./lib", "declaration": true, "strict": true, }, "include": ["src"], "exclude": ["node_modules","tests"] }jest.config.js
When I run
tsc, it is ok. But if I run jest to test,it is failed.Expected behavior:
Avoid and exclude tests ts files.
Actual behavior:
It check ts files in the
testsfolder which has been excluded.Workaround:
But if a restart VS then i will see the same behavior.
error:
Here is my project:
https://github.com/changchangge/simple-redux/tree/tag2
I hope that someone can help me , thanks!