angular testbed : "Can't resolve all parameters for ..." despite providers

41 Views Asked by At

for all my components who have dependencies in their constructor, when I do the "compileComponents" I have an error : Error: Can't resolve all parameters for AsciiCharacterComponent: (?).

I include those dependencies with providers:

someMock = {...}
TestBed.configureTestingModule({
      declarations: [AsciiCharacterComponent, AsciiComponent],
      imports: [],
      providers: [
        {
          provide: SomeService,
          useValue: someMock
        },
      ],
    }).compileComponents();

note that if I use:

providers: [SomeService]

It work.

Any idea?

0

There are 0 best solutions below