blob: 0e9c4d8522535e61e60b802e57ca1f9626a8361c [file] [log] [blame]
Matteo Scandoloe5be1822016-05-25 08:53:11 -07001// 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});
13
14module.exports = function(config) {
15/*eslint-enable*/
16 config.set({
17
18 // base path that will be used to resolve all patterns (eg. files, exclude)
19 basePath: '',
20
21
22 // frameworks to use
23 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
24 frameworks: ['jasmine'],
25
26
27 // list of files / patterns to load in the browser
28 files: bowerComponents.concat([
Matteo Scandolo2aca9ab2016-05-26 15:09:55 -070029 'node_modules/babel-polyfill/dist/polyfill.js',
Matteo Scandoloe5be1822016-05-25 08:53:11 -070030 '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js',
31 '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
32 'src/js/**/*.js',
33 'spec/**/*.mock.js',
34 'spec/**/*.test.js',
35 'src/**/*.html'
36 ]),
37
38
39 // list of files to exclude
40 exclude: [
41 ],
42
43
44 // preprocess matching files before serving them to the browser
45 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
46 preprocessors: {
47 'src/js/**/*.js': ['babel'],
48 'spec/**/*.test.js': ['babel'],
49 'src/**/*.html': ['ng-html2js']
50 },
51
52 ngHtml2JsPreprocessor: {
53 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)
54 moduleName: 'templates' // define the template module name
55 },
56
57 // test results reporter to use
58 // possible values: 'dots', 'progress'
59 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
60 reporters: ['mocha'],
61
62
63 // web server port
64 port: 9876,
65
66
67 // enable / disable colors in the output (reporters and logs)
68 colors: true,
69
70
71 // level of logging
72 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
73 logLevel: config.LOG_INFO,
74
75
76 // enable / disable watching file and executing tests whenever any file changes
77 autoWatch: true,
78
79
80 // start these browsers
81 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandolo2aca9ab2016-05-26 15:09:55 -070082 browsers: [
83 'PhantomJS',
84 'Chrome'
85 ],
Matteo Scandoloe5be1822016-05-25 08:53:11 -070086
87
88 // Continuous Integration mode
89 // if true, Karma captures browsers, runs the tests and exits
90 singleRun: false
91 });
92};