diff --git a/jest-front.js b/jest-front.js index ab88dd473..3b481ad7c 100644 --- a/jest-front.js +++ b/jest-front.js @@ -17,8 +17,8 @@ core.run(vnInterceptor => { vnInterceptor.setApiPath(null); }); -window.ngModule = function(moduleName, fn) { - return angular.mock.module(moduleName, function($provide, $translateProvider) { +window.ngModule = function(moduleName, ...args) { + let fns = [moduleName, function($provide, $translateProvider) { // Avoid unexpected request warnings caused by angular translate // https://angular-translate.github.io/docs/#/guide/22_unit-testing-with-angular-translate $provide.factory('customLocaleLoader', function($q) { @@ -30,5 +30,10 @@ window.ngModule = function(moduleName, fn) { }); $translateProvider.useLoader('customLocaleLoader'); - }, fn); + }]; + + if (args.length) + fns = fns.concat(args); + + return angular.mock.module(...fns); };