I am working with angularjs and writing tests in mochajs. I implemented multi-language support in my application and now I have the problem, that in many test-cases i get an unexpected request for my language.json
Do you have any idea how to handle this, without adding the "$httpBackend.whenGet(....." for the language-handling to each test?
Both Mocha and Jasmine support root-level hooks (which will affect all describe
s).
When loaded in the first place in karma, this
angular.module('test-setup', []).run(function ($httpBackend) {
$httpBackend.whenGET(...
});
beforeEach(module('test-setup'));
should provide $httpBackend
setup for all specs.