From ab822c6061d00fc5b086ed6e00b4fb6368a0fba8 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 18 Mar 2020 14:06:06 +0100 Subject: [PATCH] Code fix --- jest-front.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); };