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