Hi I have this simple test:
define(["angular", "angularMocks", "app", "normalizer"], function(angular, mocks, app) {
describe("service: normalizer", function () {
var normalizerService;
beforeEach(module("ADB"));
beforeEach(inject(function(_normalizer_) {
normalizerService = _normalizer_;
}));
var params = {};
var metadata = {};
var data = {};
var response = normalizerService.topLanguagesHybrid(metadata, data, params);
var type = typeof response;
expect(type).toEqual("object");
});
});
The issue is that the normalizer service is never being set, and in cmd I see the following error:
TypeError: 'undefined' is not an object (evaluating 'normalizerService.topLanguagesHybrid')
Note: I am using requirejs in this project and I can see that normalizer service file is being loaded into the browser (with all of its dependencies). It seems that it just not injected. What did I do wrong?
Aucun commentaire:
Enregistrer un commentaire