Angular unit tests TypeError: this.http.get(…).pipe is not a function

前端 未结 2 1628
梦毁少年i
梦毁少年i 2021-01-17 19:45

I\'m following this example to make a unit test for service (get request coming from spring app backend) https://angular.io/guide/testing#testing-http-services

Servi

2条回答
  •  无人及你
    2021-01-17 20:28

    I had to do this to get mine to work:

    import { from } from 'rxjs';
    

    then:

    return from([expectedTarifs]);
    

提交回复
热议问题