Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 1 | const conf = require('./gulp.conf'); |
Matteo Scandolo | a4a4711 | 2016-12-16 10:06:13 -0800 | [diff] [blame] | 2 | const pkg = require('../package.json'); |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 3 | |
| 4 | module.exports = function (config) { |
| 5 | const configuration = { |
| 6 | basePath: '../', |
| 7 | singleRun: false, |
| 8 | autoWatch: true, |
| 9 | logLevel: 'INFO', |
| 10 | junitReporter: { |
| 11 | outputDir: 'test-reports' |
| 12 | }, |
| 13 | browsers: [ |
Matteo Scandolo | a4a4711 | 2016-12-16 10:06:13 -0800 | [diff] [blame] | 14 | 'PhantomJS', |
Matteo Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 15 | // 'Chrome' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 16 | ], |
| 17 | frameworks: [ |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 18 | 'jasmine', |
| 19 | 'es6-shim' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 20 | ], |
| 21 | files: [ |
| 22 | 'node_modules/es6-shim/es6-shim.js', |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 23 | conf.path.src('index.spec.js'), |
| 24 | conf.path.src('**/*.html') |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 25 | ], |
| 26 | preprocessors: { |
| 27 | [conf.path.src('index.spec.js')]: [ |
| 28 | 'webpack' |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 29 | ], |
| 30 | [conf.path.src('**/*.html')]: [ |
| 31 | 'ng-html2js' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 32 | ] |
| 33 | }, |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 34 | ngHtml2JsPreprocessor: { |
| 35 | stripPrefix: `${conf.paths.src}/` |
| 36 | }, |
Matteo Scandolo | 40f8fa9 | 2016-12-07 09:21:35 -0800 | [diff] [blame] | 37 | reporters: ['mocha', 'coverage'], |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 38 | coverageReporter: { |
| 39 | type: 'html', |
| 40 | dir: 'coverage/' |
| 41 | }, |
| 42 | webpack: require('./webpack-test.conf'), |
| 43 | webpackMiddleware: { |
| 44 | noInfo: true |
| 45 | }, |
| 46 | plugins: [ |
| 47 | require('karma-jasmine'), |
| 48 | require('karma-junit-reporter'), |
| 49 | require('karma-coverage'), |
Matteo Scandolo | 40f8fa9 | 2016-12-07 09:21:35 -0800 | [diff] [blame] | 50 | require('karma-phantomjs-launcher'), |
Matteo Scandolo | a4a4711 | 2016-12-16 10:06:13 -0800 | [diff] [blame] | 51 | require('karma-chrome-launcher'), |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 52 | require('karma-phantomjs-shim'), |
| 53 | require('karma-ng-html2js-preprocessor'), |
| 54 | require('karma-webpack'), |
| 55 | require('karma-es6-shim'), |
| 56 | require('karma-mocha-reporter') |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 57 | ] |
| 58 | }; |
| 59 | |
| 60 | config.set(configuration); |
| 61 | }; |