Force membership auto-renew on by default
[civicrm-core.git] / karma.conf.js
CommitLineData
5438399c
TO
1var cv = require('civicrm-cv')({mode: 'sync'});
2var _CV = cv('vars:show');
3var cmd =
4 'CRM_Core_BAO_ConfigSetting::enableComponent("CiviCase");' +
5 'global $civicrm_root;' +
6 '$f = CRM_Utils_File::addTrailingSlash($civicrm_root)."tmp/karma.cv.js";' +
7 'mkdir(dirname($f), 0777, TRUE);' +
8 '$a=Civi::service("angular");' +
9 '$data = "var CRM = CRM || {}; CRM.angular =";' +
10 '$data .= json_encode(array(' +
11 ' "modules" => array_keys($a->getModules()),' +
12 ' "requires" => $a->getResources(array_keys($a->getModules()), "requires","requires"),' +
13 '));' +
14 '$data .= ";";' +
15 'file_put_contents($f, $data);' +
16 'return $f;';
17var angularTempFile = cv(['php:eval', '-U', _CV.ADMIN_USER, cmd]);
18
416abe87
PH
19module.exports = function(config) {
20 config.set({
21 autoWatch: true,
5915de41 22 browsers: ['PhantomJS'],
416abe87 23 exclude: [
2c074028 24 'ang/api4Explorer/Explorer.js'
416abe87
PH
25 ],
26 files: [
6a77bdf4 27 'bower_components/phantomjs-polyfill/bind-polyfill.js',
416abe87
PH
28 'bower_components/jquery/dist/jquery.min.js',
29 'bower_components/jquery-ui/jquery-ui.min.js',
b2df037d 30 'bower_components/lodash-compat/lodash.min.js',
e1ef4e11 31 'bower_components/select2/select2.min.js',
416abe87 32 'packages/jquery/plugins/jquery.blockUI.js',
3426f10d 33 'bower_components/jquery-validation/dist/jquery.validate.min.js',
401f6f82 34 'packages/jquery/plugins/jquery.timeentry.js',
416abe87 35 'js/Common.js',
403c52ac 36 'js/crm.datepicker.js',
416abe87 37 'bower_components/angular/angular.js',
5438399c
TO
38 'js/crm.angular.js',
39 angularTempFile,
416abe87
PH
40 'bower_components/angular-file-upload/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-ui-utils/ui-utils.js',
46 'bower_components/angular-unsavedChanges/dist/unsavedChanges.js',
416abe87 47 'js/crm.ajax.js',
4c78db19
TO
48 'ang/*.js',
49 'ang/**/*.js',
416abe87
PH
50 'tests/karma/lib/*.js',
51 'tests/karma/**/*.js',
4c78db19 52 'ang/**/*.html'
416abe87 53 ],
401f6f82 54 preprocessors : {
4c78db19 55 'ang/**/*.html' : ['ng-html2js']
401f6f82
TO
56 },
57
58 ngHtml2JsPreprocessor: {
4c78db19 59 stripPrefix: 'ang/',
401f6f82
TO
60 prependPrefix: '~/',
61 moduleName: 'crmResource'
62 },
416abe87
PH
63 frameworks: ['jasmine'],
64 logLevel: config.LOG_INFO,
65 port: 9876,
66 reporters: ['progress'],
8ae4e322 67 junitReporter: {
75181cda 68 useBrowserName: false,
8ae4e322
TO
69 outputFile: 'tests/output/karma.xml',
70 suite: ''
71 },
b43a993a 72 singleRun: false
416abe87
PH
73 });
74};