Reputation: 245
When i use the Mock to test the Angular,why 'provide' cannot be find.
beforeEach(() => {
TestBed.configureTestingModule({
providers : [
provide(StrategyTablesService,{useClass:MockstrategyService})
]
});
});
Upvotes: 1
Views: 1427
Reputation: 1472
Maybe you have to use an object provide
instead the function
beforeEach(() => {
TestBed.configureTestingModule({
providers: [{
provide: StrategyTablesService, useClass: MockstrategyService }]
});
});
Upvotes: 4
Reputation: 5957
You need to use angular.mock.module()
beforeEach(() => {
angular.mock.module(($provide) => {
TestBed.configureTestingModule({
providers: [
$provide.value(StrategyTablesService, { useClass:MockstrategyService });
]
});
});
});
Upvotes: 0