lundi 27 juillet 2015

AngularJS Karma expectGet Unit Test Failing

navsearchService.getNewsData(scope)
                .then(function (response) {
                    expect(response).toBeTruthy();
                });

            $httpBackend.expectGET(/.*\/news\/search\/apple/).respond(200, mock);
            $httpBackend.flush();

I have the above unit test I'm trying to get working but I get the following error in Terminal

PhantomJS 1.9.8 (Mac OS X 0.0.0) app.navsearch navSearch should getNewsData FAILED
    Error: Unexpected request: GET http://ift.tt/1LOr2Ep
    Expected GET /.*\/news\/search\/apple/

Could someone be kind enough to point me in the right direction and get this working?

Aucun commentaire:

Enregistrer un commentaire