X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=karma.conf.js;h=1710c33fdc590a2ebc269766c99e930cde51ba5f;hb=efefb1d7ba4492005241b18e61e5b7d55c610853;hp=50c56bf3e94e34127f49510239d03972f15ebed3;hpb=fd57ced7b04d32d5fab5e68c1b12aedbf35c2ad8;p=civicrm-core.git diff --git a/karma.conf.js b/karma.conf.js index 50c56bf3e9..1710c33fdc 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,10 +1,30 @@ +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, browsers: ['PhantomJS'], exclude: [ + 'ang/api4Explorer/Explorer.js' ], 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', @@ -13,7 +33,10 @@ module.exports = function(config) { 'bower_components/jquery-validation/dist/jquery.validate.min.js', 'packages/jquery/plugins/jquery.timeentry.js', 'js/Common.js', + 'js/crm.datepicker.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,20 +44,19 @@ 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', - 'js/angular-*.js', - 'js/angular-crmMailing/*.js', + 'ang/*.js', + 'ang/**/*.js', 'tests/karma/lib/*.js', 'tests/karma/**/*.js', - 'partials/**/*.html' + 'ang/**/*.html' ], preprocessors : { - 'partials/**/*.html' : ['ng-html2js'] + 'ang/**/*.html' : ['ng-html2js'] }, ngHtml2JsPreprocessor: { - stripPrefix: 'partials/', + stripPrefix: 'ang/', prependPrefix: '~/', moduleName: 'crmResource' }, @@ -43,6 +65,7 @@ module.exports = function(config) { port: 9876, reporters: ['progress'], junitReporter: { + useBrowserName: false, outputFile: 'tests/output/karma.xml', suite: '' },