[email protected]
[email protected]
[email protected]
@angular/*@7.2.11
@angular/[email protected]
FAIL src/app/file.spec.ts
โ Test suite failed to run
TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
error TS6053: File 'C:/Users/.../projectHome/src/test.ts' not found.
I just upgraded from jest-preset-angular 6 to 7 and I get this error. Downgrading to version 6.0.2 works.
This are my config files:
// jest.config.js
module.exports = {
preset: 'jest-preset-angular',
roots: ['src'],
setupFilesAfterEnv: ["./src/setup-jest.ts"],
transformIgnorePatterns: [
"node_modules/(?!@ngrx|angular2-ui-switch|ng-dynamic)"
],
testPathIgnorePatterns: [
'/node_modules/',
'/src/environments/'
],
moduleDirectories: [
".",
"src",
"src/util",
"node_modules"
],
moduleNameMapper: {
'@config/(.*)': 'src/app/config/$1',
'@dashboard/(.*)': 'src/app/dashboard/$1',
'@documents/(.*)': 'src/app/documents/$1',
"@kyc/(.*)": "src/app/kyc/$1",
'@logging/(.*)': 'src/app/logging/$1',
'@mapping/(.*)': 'src/app/mapping/$1',
'@reviews/(.*)': 'src/app/review/$1',
'@root/(.*)': 'src/app/root/$1',
'@shared/(.*)': 'src/app/shared/$1',
'@signalr/(.*)': 'src/app/signalr/$1',
'@store': 'src/app/store',
'@store/(.*)': 'src/app/store/$1',
'@users/(.*)': 'src/app/users/$1',
'@util': 'src/app/util',
'@util/(.*)': 'src/app/util/$1',
"@verifications/(.*)": "src/app/verifications/$1",
}
};
// src/setup-jest.js
import 'jest-preset-angular';
import './jestGlobalMocks';
Can you share your src/tsconfig.spec.ts?
Does the file src/test.ts exist in your project?
// ts.config.spec
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"module": "commonjs",
"types": [
"jest",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
I removed the src/test.ts along with the angular.json "test" script karma builder as I don't need them. I just test with the command "jest".
Oh, I'm sorry, I didn't look at tsconfig.spec. I jsut removed test.ts from files array. Sorry.
It turns out that all the test suite now is very slow. Before it took 42 secs, now I killed the process at 300secs
Yeah, that's a known issue. Check #242 and the further linked issues there.
We decided to publish v7 as holding it back would have handicapped the compatibility with the newest jest and ts-jest version, which bring many new features.
The speed deficit lies in ts-jest and jest, but we are not 100% sure where exactly.
Most helpful comment
I removed the src/test.ts along with the angular.json "test" script karma builder as I don't need them. I just test with the command "jest".