Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Can't respond to $httpBackend expecations in ngMockE2E #8100

Open
@elnur

Description

@elnur

I can define expectations for ngMockE2E's $httpBackend the following way:

$httpBackend.expectGET(url);

At the end of my Protractor tests I can check whether expectations have been met:

$httpBackend.verifyNoOutstandingExpectation();

But I can't set a response on an expectation. This doesn't work:

$httpBackend
    .expectGET(url)
    .respond(response);

My current solution is to define an expect method and then a when method:

$httpBackend.expectGET(url);
$httpBackend
    .whenGET(url)
    .respond(response);

Now, this works, but it's ugly because I have to define a when for each expect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions