blob: cbc5a83c0b4772055548e28592ac429db5e6bee2 [file] [log] [blame]
Matteo Scandoloe3de73d2015-12-04 10:14:40 -08001// Karma configuration
2// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
3
4/* eslint indent: [2,2], quotes: [2, "single"]*/
5
6/*eslint-disable*/
7var wiredep = require('wiredep');
8var path = require('path');
9
10var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){
11 return path.relative(process.cwd(), file);
12});
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080013/*eslint-enable*/
Matteo Scandolo48d890f2015-12-14 17:36:09 -080014module.exports = function(config) {
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080015 config.set({
16
17 // base path that will be used to resolve all patterns (eg. files, exclude)
18 basePath: '',
19
20
21 // frameworks to use
22 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
23 frameworks: ['jasmine'],
24
25
26 // list of files / patterns to load in the browser
27 files: bowerComponents.concat([
28 'src/css/**/*.css',
Matteo Scandolo89b179c2016-03-24 11:38:50 -070029 '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js',
Matteo Scandolo10e61732016-02-02 16:04:31 -080030 '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
Matteo Scandolo89b179c2016-03-24 11:38:50 -070031 '../../../xos/core/xoslib/static/js/xosApi.js',
32 'src/js/main.js',
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080033 'src/js/**/*.js',
34 'spec/**/*.mock.js',
35 'spec/**/*.test.js',
36 'src/**/*.html'
37 ]),
38
39
40 // list of files to exclude
41 exclude: [
42 ],
43
44
45 // preprocess matching files before serving them to the browser
46 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
47 preprocessors: {
48 'src/js/**/*.js': ['babel'],
Matteo Scandolo48d890f2015-12-14 17:36:09 -080049 'spec/**/*.js': ['babel'],
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080050 'src/**/*.html': ['ng-html2js']
51 },
52
Matteo Scandolo48d890f2015-12-14 17:36:09 -080053 babelPreprocessor: {
54 options: {
55 presets: ['es2015'],
56 sourceMap: 'inline'
57 }
58 },
59
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080060 ngHtml2JsPreprocessor: {
61 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)
62 moduleName: 'templates' // define the template module name
63 },
64
65 // test results reporter to use
66 // possible values: 'dots', 'progress'
67 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
68 reporters: ['mocha'],
69
70
71 // web server port
72 port: 9876,
73
74
75 // enable / disable colors in the output (reporters and logs)
76 colors: true,
77
78
79 // level of logging
80 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
81 logLevel: config.LOG_INFO,
82
83
84 // enable / disable watching file and executing tests whenever any file changes
85 autoWatch: true,
86
87
88 // start these browsers
89 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
90 browsers: ['PhantomJS'],
91
92
93 // Continuous Integration mode
94 // if true, Karma captures browsers, runs the tests and exits
95 singleRun: false
96 });
97};