blob: c0b950915842fb52be138c07a103cff648876a4a [file] [log] [blame]
Matteo Scandolod819c922016-12-02 14:06:14 -08001const conf = require('./gulp.conf');
2
3module.exports = function (config) {
4 const configuration = {
5 basePath: '../',
6 singleRun: false,
7 autoWatch: true,
8 logLevel: 'INFO',
9 junitReporter: {
10 outputDir: 'test-reports'
11 },
12 browsers: [
Matteo Scandolo40f8fa92016-12-07 09:21:35 -080013 'PhantomJS'
Matteo Scandolod819c922016-12-02 14:06:14 -080014 ],
15 frameworks: [
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080016 'jasmine',
17 'es6-shim'
Matteo Scandolod819c922016-12-02 14:06:14 -080018 ],
19 files: [
20 'node_modules/es6-shim/es6-shim.js',
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080021 conf.path.src('index.spec.js'),
22 conf.path.src('**/*.html')
Matteo Scandolod819c922016-12-02 14:06:14 -080023 ],
24 preprocessors: {
25 [conf.path.src('index.spec.js')]: [
26 'webpack'
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080027 ],
28 [conf.path.src('**/*.html')]: [
29 'ng-html2js'
Matteo Scandolod819c922016-12-02 14:06:14 -080030 ]
31 },
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080032 ngHtml2JsPreprocessor: {
33 stripPrefix: `${conf.paths.src}/`
34 },
Matteo Scandolo40f8fa92016-12-07 09:21:35 -080035 reporters: ['mocha', 'coverage'],
Matteo Scandolod819c922016-12-02 14:06:14 -080036 coverageReporter: {
37 type: 'html',
38 dir: 'coverage/'
39 },
40 webpack: require('./webpack-test.conf'),
41 webpackMiddleware: {
42 noInfo: true
43 },
44 plugins: [
45 require('karma-jasmine'),
46 require('karma-junit-reporter'),
47 require('karma-coverage'),
Matteo Scandolo40f8fa92016-12-07 09:21:35 -080048 require('karma-phantomjs-launcher'),
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080049 require('karma-phantomjs-shim'),
50 require('karma-ng-html2js-preprocessor'),
51 require('karma-webpack'),
52 require('karma-es6-shim'),
53 require('karma-mocha-reporter')
Matteo Scandolod819c922016-12-02 14:06:14 -080054 ]
55 };
56
57 config.set(configuration);
58};