2017-08-25 06:42:53 +00:00
|
|
|
// require all modules ending in ".spec" from the
|
|
|
|
// current directory and all subdirectories
|
2017-08-29 10:33:48 +00:00
|
|
|
import 'angular';
|
|
|
|
import 'angular-mocks';
|
2018-10-18 18:48:21 +00:00
|
|
|
|
|
|
|
window.inject = angular.mock.inject;
|
|
|
|
|
|
|
|
window.ngModule = function(moduleName) {
|
|
|
|
return angular.mock.module(moduleName, function($provide, $translateProvider) {
|
2018-10-18 19:04:46 +00:00
|
|
|
// Avoid unexpected request warnings caused by angular translate
|
2018-10-18 18:48:21 +00:00
|
|
|
// https://angular-translate.github.io/docs/#/guide/22_unit-testing-with-angular-translate
|
|
|
|
$provide.factory('customLocaleLoader', function($q) {
|
|
|
|
return function() {
|
|
|
|
let deferred = $q.defer();
|
|
|
|
deferred.resolve({});
|
|
|
|
return deferred.promise;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
$translateProvider.useLoader('customLocaleLoader');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2018-11-02 09:48:15 +00:00
|
|
|
let testsContext = require.context('./', true, /\.spec\.js$/);
|
2017-08-25 06:42:53 +00:00
|
|
|
testsContext.keys().forEach(testsContext);
|
2018-12-22 10:59:26 +00:00
|
|
|
|
|
|
|
let modulesContext = require.context('../modules/', true, /^\.\/[a-z0-9]+\/front\/.+\.spec\.js$/);
|
|
|
|
modulesContext.keys().forEach(modulesContext);
|