beforeEach(async () => { mockApp(); $state = await getComponent("$state"); $stateParams = await getComponent("$stateParams"); $rootScope = await getComponent("$rootScope"); $timeout = await getComponent("$timeout"); });
test("All states use require as template", async () => { const $state: any = await getComponent("$state"); _.each($state.get(), state => { if (state.templateUrl) { console.error("You should use 'template: require(...)' with state:", state.name); } expect(state.templateUrl).toBeFalsy(); expect(!state.template && !state.abstract && _.isEmpty(state.views)).toBeFalsy(); if (!_.isEmpty(state.views)) { _.each(state.views, view => { expect(_.isString(view.template)).toBeTruthy(); }); } }); });
beforeEach(async () => { mockApp(); Api = await getComponent("Api"); });
beforeEach(async () => { mockApp(); PerusteenRakenne = await getComponent("PerusteenRakenne"); });
beforeEach(async () => { mockApp(); SuoritustavanSisalto = await getComponent("SuoritustavanSisalto"); });
test("Modules can be injected with getComponent", async () => { const $rootScope = await getComponent("$rootScope"); const $timeout: any = await getComponent("$timeout"); expect($rootScope).toBeTruthy(); $timeout.flush(); });
beforeEach(async () => { mockApp(); virheService = await getComponent("virheService"); });
beforeEach(async () => { Algoritmit = await getComponent("Algoritmit"); });
beforeEach(async () => { mockApp(); YleinenData = await getComponent("YleinenData"); });