forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
74 lines (72 loc) · 2.45 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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',
'bower_components/select2/select2.min.js',
'packages/jquery/plugins/jquery.blockUI.js',
'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',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/angular-ui-sortable/sortable.js',
'bower_components/angular-ui-utils/ui-utils.js',
'bower_components/angular-unsavedChanges/dist/unsavedChanges.js',
'js/crm.ajax.js',
'ang/*.js',
'ang/**/*.js',
'tests/karma/lib/*.js',
'tests/karma/**/*.js',
'ang/**/*.html'
],
preprocessors : {
'ang/**/*.html' : ['ng-html2js']
},
ngHtml2JsPreprocessor: {
stripPrefix: 'ang/',
prependPrefix: '~/',
moduleName: 'crmResource'
},
frameworks: ['jasmine'],
logLevel: config.LOG_INFO,
port: 9876,
reporters: ['progress'],
junitReporter: {
useBrowserName: false,
outputFile: 'tests/output/karma.xml',
suite: ''
},
singleRun: false
});
};