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