Using Jest I get: Cannot find type definition file for 'jasmine'

后端 未结 3 1099
自闭症患者
自闭症患者 2021-02-08 22:44

I am using Angular 7 and Jest. When I was running jest with --codecoverage, all my tests passed but many branches in the constructor were not covered (similar to: B

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-08 23:09

    Go to tsconfig.spec.json in the types field under the compilerOptions and remove jasmine and add jest

    "compilerOptions": {
    "module": "commonjs",
    "outDir": "./out-tsc/spec",
    "types": ["jest", "node"]
    }
    

提交回复
热议问题