1 var cv
= require('civicrm-cv')({mode
: 'sync'});
2 var _CV
= cv('vars:show');
4 'define("CIVICRM_KARMA", 1);' +
5 'CRM_Core_BAO_ConfigSetting::enableAllComponents();' +
6 'global $civicrm_root;' +
7 '$f = CRM_Utils_File::addTrailingSlash($civicrm_root)."tmp/karma.cv.js";' +
8 'mkdir(dirname($f), 0777, TRUE);' +
9 '$a=Civi::service("angular");' +
10 '$data = "var CRM = CRM || {}; CRM.angular =";' +
11 '$data .= json_encode(array(' +
12 ' "modules" => array_keys($a->getModules()),' +
13 ' "requires" => $a->getResources(array_keys($a->getModules()), "requires","requires"),' +
16 'file_put_contents($f, $data);' +
18 var angularTempFile
= cv(['php:eval', '-U', _CV
.ADMIN_USER
, cmd
]);
20 module
.exports = function(config
) {
23 browsers
: ['PhantomJS'],
25 'ang/api4Explorer/Explorer.js'
28 'bower_components/phantomjs-polyfill/bind-polyfill.js',
29 'bower_components/jquery/dist/jquery.min.js',
30 'bower_components/jquery-ui/jquery-ui.min.js',
31 'bower_components/lodash-compat/lodash.min.js',
32 'bower_components/select2/select2.min.js',
33 'packages/jquery/plugins/jquery.blockUI.js',
34 'bower_components/jquery-validation/dist/jquery.validate.min.js',
35 'packages/jquery/plugins/jquery.timeentry.js',
37 'js/crm.datepicker.js',
38 'bower_components/angular/angular.js',
40 'bower_components/angular-file-upload/dist/angular-file-upload.js',
41 'bower_components/angular-jquery-dialog-service/dialog-service.js',
42 'bower_components/angular-route/angular-route.js',
43 'bower_components/angular-mocks/angular-mocks.js',
44 'bower_components/angular-ui-sortable/sortable.js',
45 'bower_components/angular-unsavedChanges/dist/unsavedChanges.js',
49 'tests/karma/lib/*.js',
50 'tests/karma/**/*.js',
54 'ang/**/*.html' : ['ng-html2js']
57 ngHtml2JsPreprocessor
: {
60 moduleName
: 'crmResource'
62 frameworks
: ['jasmine'],
63 logLevel
: config
.LOG_INFO
,
65 reporters
: ['progress'],
67 useBrowserName
: false,
68 outputFile
: 'tests/output/karma.xml',