angularionic-frameworkkarma-jasminejasmine-nodejasmine2.0

Failed: Invalid provider for the NgModule 'DynamicTestModule' - only instances of Provider and Type are allowed, got: [[object Object]?]


So there's this delightful error that's the very definition of annoying

this is the describe method:

beforeEach(async(() => {
TestBed.configureTestingModule({
  declarations: [ MapMap ],
  imports: [IonicStorageModule.forRoot()],
  providers: [PopoverController, AngularDelegate, UrlSerializer, File]
  }).compileComponents();

First it had no providers, but then complained that it needed those providers. After I added those providers it produced the error

"Failed: Invalid provider for the NgModule 'DynamicTestModule' - only instances of Provider and Type are allowed, got: [..., ..., ..., ..., ..., ?[object Object]?] "

I tried looking for answers but cannot find anything


Solution

  • just add "ngx" to the end of "import { File } from '@ionic-native/file'; "