I am using ngx-bootstrap's (3.0.1) ModalService to show a modal dialog containing a component
this.modalRef = this.modalService.show(MyDialogComponent);
and I have this in my unit test (run by jest)
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [MyComponent, MyDialogComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [MyService],
imports: [
ModalModule.forRoot(),
],
})
.compileComponents();
}));
The stubborn error tells me Can't resolve all parameters for BsModalService: (?, ?). The answers I was able to find were mentioning lack of a proper @Injectable()
decorator, but this is obviously beyond my control and besides all it is irrelevant and misleading - the decorator is present in the source code of ngx-bootstrap.
I tried to explicitly provide all the components and services from the package (rather than ModuleWithProviders, but this didn't help either.
Running short of ideas.
Update 1
Tried commenting in and out
import 'core-js/es7/reflect';
in plyfills.ts. Doesn't seem to matter. Unless there is a Jest config setting associated with that that I am missing?