Coding task · Angular course · Module 11: Testing

Practice: HTTP Test

provideHttpClientTesting() swaps the HttpClient backend for a mock. The HTTP testing controller (the one you get with TestBed.inject) catches a request with expectOne(), and a method of the caught request delivers the fake response, which only then reaches the code in subscribe.

Task

Complete the HTTP service test that checks fetching the list of samurai.