所以,我知道为什么我的单元测试失败了。但是我想知道是否有什么好的方法可以解决这个问题。请找到下面的代码。谢谢!
//测试用例
it('it should get data from ContactInfoSelection endpoint based on the url
inputted', () => {
const url ='contact-info-selection';
const { service, get } = spectator;
const http = get<HttpClient>(HttpClient).get.and.returnValue(of());
service.getserviceResponse(url).subscribe();
expect(http.calls.first().args[0]).toEqual(
environment.urls.ContactInfoSelection
); });
//我得到的错误:
- Expected
+ Received
- https://localhost/contact-info-selection
+ contact-info-selection