I have a very simple service call and a jasmine test for it.
Service call:
myServiceCall(testId: number) : void {
const url = `${this.url}/param
You are already calling httpMock.verify()
, which should fail if there are unexpected requests, and log some information about those requests to the console. If your expectOne
failed with a "found none", and verify
did not fail, then your service must not actually have called http.put()
. Add some logging or step through the test in a debugger to see what's actually happening.
As other answers have pointed out, this could be due to timing issues. Your service call does not return an Observable or Promise so your spec can't tell when it finishes. This means you'll have to manipulate time with waitForAsync
or fakeAsync
.