blob: 399cdfde770fe5f3aaaecefcd60fac462890dffa [file] [log] [blame]
Matteo Scandoloa5d03d52016-07-21 11:35:46 -07001/*eslint-env node */
2(function () {
3
4 'use strict';
5
6 // Karma configuration
7 // Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
8
9 const babelPreset = require('babel-preset-es2015');
10
11 /*eslint-disable*/
12
13 var files = [
14 'node_modules/babel-polyfill/dist/polyfill.js',
15
16
17 // loading jquery (it's used in tests)
18 `./bower_components/jquery/dist/jquery.js`,
19 `./bower_components/jasmine-jquery/lib/jasmine-jquery.js`,
20
21 // loading helpers and vendors
22 `./dist/ngXosVendor.min.js`,
23 `./dist/ngXosHelpers.min.js`,
24
25 // loading ngMock
26 `./bower_components/angular-mocks/angular-mocks.js`,
27 ]
28 .concat([
29 // loading tests
30 `spec/test_helpers.js`,
31 'spec/**/*.test.js'
32 ]);
33
34 module.exports = function(config) {
35 /*eslint-enable*/
36 config.set({
37
38 // base path that will be used to resolve all patterns (eg. files, exclude)
39 basePath: '',
40
41
42 // frameworks to use
43 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
44 frameworks: ['jasmine'],
45
46
47 // list of files / patterns to load in the browser
48 files: files,
49
50
51 // list of files to exclude
52 exclude: [
53 ],
54
55
56 // preprocess matching files before serving them to the browser
57 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
58 preprocessors: {
59 './spec/**/*.test.js': ['babel'],
60 './spec/test_helpers.js': ['babel'],
61 },
62
63 babelPreprocessor: {
64 options: {
65 presets: [babelPreset],
66 sourceMap: 'inline'
67 }
68 },
69
70 //ngHtml2JsPreprocessor: {
71 // stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
72 // moduleName: 'templates' // define the template module name
73 //},
74
75 // test results reporter to use
76 // possible values: 'dots', 'progress'
77 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
78 reporters: ['dots', 'junit', 'coverage'],
79
80 junitReporter: {
81 outputDir: 'test-result',
82 useBrowserName: false,
83 outputFile: 'test-results.xml'
84 },
85
86 coverageReporter: {
87 type: 'cobertura',
88 subdir: '.',
89 dir: 'test-result/'
90 },
91
92 // web server port
93 port: 9876,
94
95
96 // enable / disable colors in the output (reporters and logs)
97 colors: true,
98
99
100 // level of logging
101 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
102 logLevel: config.LOG_INFO,
103
104
105 // enable / disable watching file and executing tests whenever any file changes
106 autoWatch: false,
107
108
109 // start these browsers
110 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
111 browsers: [
112 'PhantomJS',
113 // 'Chrome'
114 ],
115
116
117 // Continuous Integration mode
118 // if true, Karma captures browsers, runs the tests and exits
119 singleRun: true
120 });
121 };
122
123})();