I have a test (using jasmine syntax from the AngularDart project)
describe("MockHttpBackend", () {
beforeEach(() {
setUpInjector();
module((Module module) {
module
..type(HttpBackend, implementedBy: MockHttpBackend);
// ..value(HttpBackend, new MockHttpBackend()); // same problem
});
});
it('should do basic request', async(inject((Http http, MockHttpBackend backend) {
backend.expect('GET', '/url').respond('');
http(url: '/url', method: 'GET');
})));
which results in
Test failed: Caught [Async error, [Unexpected request: GET /url No more requests expected],
#0 > MockHttpBackend.call (package:angular/mock/http_backend.dart:224:5)
#1 MockHttpBackend.request (package:angular/mock/http_backend.dart:137:9)
Any idea what I'm doing wrong?