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

后端 未结 3 1100
自闭症患者
自闭症患者 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 22:58

    I was getting the following error when trying to run Jest in my Angular project.

    TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics option): error TS2688: Cannot find type definition file for 'jquery'. error TS2688: Cannot find type definition file for 'jsdom'.

    For me I had to add the type definition packages.

    yarn add @types/jquery @types/jsdom --dev
    

    After that these errors stopped.

提交回复
热议问题