X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=karma.conf.js;h=76a758c2cebc181dee324345fcf15b5e2beaf07e;hb=820c3c520f55df03ca5e7b6c0beceb882f3161ec;hp=eada18ded519964e83d60c5e5d179d07534fd613;hpb=817af9449a6cbf7fc06bf5c4490d62d64cece6f1;p=civicrm-core.git diff --git a/karma.conf.js b/karma.conf.js index eada18ded5..76a758c2ce 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,3 +1,21 @@ +var cv = require('civicrm-cv')({mode: 'sync'}); +var _CV = cv('vars:show'); +var cmd = + 'CRM_Core_BAO_ConfigSetting::enableComponent("CiviCase");' + + 'global $civicrm_root;' + + '$f = CRM_Utils_File::addTrailingSlash($civicrm_root)."tmp/karma.cv.js";' + + 'mkdir(dirname($f), 0777, TRUE);' + + '$a=Civi::service("angular");' + + '$data = "var CRM = CRM || {}; CRM.angular =";' + + '$data .= json_encode(array(' + + ' "modules" => array_keys($a->getModules()),' + + ' "requires" => $a->getResources(array_keys($a->getModules()), "requires","requires"),' + + '));' + + '$data .= ";";' + + 'file_put_contents($f, $data);' + + 'return $f;'; +var angularTempFile = cv(['php:eval', '-U', _CV.ADMIN_USER, cmd]); + module.exports = function(config) { config.set({ autoWatch: true, @@ -5,6 +23,7 @@ module.exports = function(config) { exclude: [ ], files: [ + 'bower_components/phantomjs-polyfill/bind-polyfill.js', 'bower_components/jquery/dist/jquery.min.js', 'bower_components/jquery-ui/jquery-ui.min.js', 'bower_components/lodash-compat/lodash.min.js', @@ -14,6 +33,8 @@ module.exports = function(config) { 'packages/jquery/plugins/jquery.timeentry.js', 'js/Common.js', 'bower_components/angular/angular.js', + 'js/crm.angular.js', + angularTempFile, 'bower_components/angular-file-upload/angular-file-upload.js', 'bower_components/angular-jquery-dialog-service/dialog-service.js', 'bower_components/angular-route/angular-route.js', @@ -21,7 +42,6 @@ module.exports = function(config) { 'bower_components/angular-ui-sortable/sortable.js', 'bower_components/angular-ui-utils/ui-utils.js', 'bower_components/angular-unsavedChanges/dist/unsavedChanges.js', - 'tests/karma/modules.js', 'js/crm.ajax.js', 'ang/*.js', 'ang/**/*.js',