1
コンポーネントに含まれる別のサービスに依存するサービスを模擬するにはどうすればよいですか? 以下のコードを確認してください。角2 - 他のサービスに依存するコンポーネント内のモッキングサービス
a.component.ts
@Component({
selector: 'my-comp',
templateUrl: './my.component.html',
providers: [ MyServiceA ]
})
export class MyComponent {
私-サービスa.service.ts
@Injectable()
export class MyServiceA{
constructor(private myServiceB: MyServiceB) {}
私-サービスb.service.ts
export class MyServiceB{
constructor(private myServiceC: MyServiceC,
private myServiceD: MyServiceD) {}
TestBed設定のa.component.spec.tsでサービスを模擬するにはどうすればよいですか?助けてください。ありがとうございました。