blob: d4137a0d5dbfad09f5849680976ea0f26ef723dd [file] [log] [blame]
Matteo Scandolo57483dd2015-11-05 11:58:53 +01001// 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
Matteo Scandolo061094b2016-03-24 14:07:49 -070014var files = bowerComponents.concat([
15 'api/**/*.js',
16 'xosHelpers/src/*.module.js',
17 'xosHelpers/src/**/*.js',
18 'xosHelpers/spec/**/*.test.js'
19]);
20
21console.log('files', files)
Matteo Scandolo8420f622016-03-24 11:38:50 -070022
Matteo Scandolo57483dd2015-11-05 11:58:53 +010023module.exports = function(config) {
24/*eslint-enable*/
25 config.set({
26
27 // base path that will be used to resolve all patterns (eg. files, exclude)
28 basePath: '',
29
30
31 // frameworks to use
32 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
33 frameworks: ['jasmine'],
34
35
36 // list of files / patterns to load in the browser
Matteo Scandolo061094b2016-03-24 14:07:49 -070037 files: files,
Matteo Scandolo57483dd2015-11-05 11:58:53 +010038
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: {
Matteo Scandolo8420f622016-03-24 11:38:50 -070048 '**/*.test.js': ['babel']
Matteo Scandolo57483dd2015-11-05 11:58:53 +010049 },
50
Matteo Scandolo8420f622016-03-24 11:38:50 -070051 babelPreprocessor: {
52 options: {
53 presets: ['es2015'],
54 sourceMap: 'inline'
55 },
56 filename: function (file) {
57 return file.originalPath;
58 },
Matteo Scandolo57483dd2015-11-05 11:58:53 +010059 },
60
Matteo Scandolo8420f622016-03-24 11:38:50 -070061 //ngHtml2JsPreprocessor: {
62 // 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)
63 // moduleName: 'templates' // define the template module name
64 //},
65
Matteo Scandolo57483dd2015-11-05 11:58:53 +010066 // test results reporter to use
67 // possible values: 'dots', 'progress'
68 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
69 reporters: ['mocha'],
70
71
72 // web server port
73 port: 9876,
74
75
76 // enable / disable colors in the output (reporters and logs)
77 colors: true,
78
79
80 // level of logging
81 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
Matteo Scandolo8420f622016-03-24 11:38:50 -070082 logLevel: config.LOG_INFO,
Matteo Scandolo57483dd2015-11-05 11:58:53 +010083
84
85 // enable / disable watching file and executing tests whenever any file changes
86 autoWatch: true,
87
88
89 // start these browsers
90 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandolo061094b2016-03-24 14:07:49 -070091 browsers: ['PhantomJS', 'Chrome'],
Matteo Scandolo57483dd2015-11-05 11:58:53 +010092
93
94 // Continuous Integration mode
95 // if true, Karma captures browsers, runs the tests and exits
96 singleRun: false
97 });
98};