This is my AngularJS:
self.fetch = {
things: function() {
return $http.get("/things/")
.then(function(response) {
return response.data;
});
}
};
And this is my test:
it('fetch.things() should GET to /things/, success', function() {
mockBackend.expectGET("/thingss/").respond({stuffs: 'stuffs'});
var response = BaseService.fetch.things();
mockBackend.flush();
expect(response).toEqual({stuffs: 'stuffs'})
});
And this is the error I get:
Expected Object({ $$state: Object({ status: 1, value: Object({ stuffs: 'stuffs' }) }) }) to equal Object({ stuffs: 'stuffs' }).
at Object.<anonymous> (tests/test_base.js:28:26)
Chromium 53.0.2785 (Ubuntu 0.0.0): Executed 1 of 1 (1 FAILED) (0 secs / 0.102 seChromium 53.0.2785 (Ubuntu 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.119 secs / 0.102 secs)
What is this additional status: 1,material and where is it from?
source
share