blob: 12d069743f0dceecd6cfda73cb40bca483e37903 [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',
29 '../../static/js/xosApi.js',
30 '../../static/js/vendor/ngXosHelpers.js',
31 'src/js/**/*.js',
32 'spec/**/*.mock.js',
33 'spec/**/*.test.js',
34 'src/**/*.html'
35 ]),
36
37
38 // list of files to exclude
39 exclude: [
40 ],
41
42
43 // preprocess matching files before serving them to the browser
44 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
45 preprocessors: {
46 'src/js/**/*.js': ['babel'],
Matteo Scandolo48d890f2015-12-14 17:36:09 -080047 'spec/**/*.js': ['babel'],
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080048 'src/**/*.html': ['ng-html2js']
49 },
50
Matteo Scandolo48d890f2015-12-14 17:36:09 -080051 babelPreprocessor: {
52 options: {
53 presets: ['es2015'],
54 sourceMap: 'inline'
55 }
56 },
57
Matteo Scandoloe3de73d2015-12-04 10:14:40 -080058 ngHtml2JsPreprocessor: {
59 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)
60 moduleName: 'templates' // define the template module name
61 },
62
63 // test results reporter to use
64 // possible values: 'dots', 'progress'
65 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
66 reporters: ['mocha'],
67
68
69 // web server port
70 port: 9876,
71
72
73 // enable / disable colors in the output (reporters and logs)
74 colors: true,
75
76
77 // level of logging
78 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
79 logLevel: config.LOG_INFO,
80
81
82 // enable / disable watching file and executing tests whenever any file changes
83 autoWatch: true,
84
85
86 // start these browsers
87 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
88 browsers: ['PhantomJS'],
89
90
91 // Continuous Integration mode
92 // if true, Karma captures browsers, runs the tests and exits
93 singleRun: false
94 });
95};