简体   繁体   中英

Can not find module import { async, TestBed } from '@angular/core/testing'; import { IonicModule } from 'ionic-angular';

Can not find module:

import { async, TestBed } from '@angular/core/testing';

import { IonicModule } from 'ionic-angular';

I am using ionic 3, wanted to do Unit testing on my application but facing problem in spec.ts file, which is unable to find modules.

I am using Karma and jasmine for unit testing

It may happen that in your tsconfig.json , you might have put "**/*.spec.ts" under "exclude". So, remove it from there and put it under "include". Please check this link for reference.

Cannot find module in .spec.ts file in Ionic 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM