blob: e66de9c3f02650721d5ab8296451afb537e0bd26 [file] [log] [blame]
Matteo Scandolod819c922016-12-02 14:06:14 -08001const conf = require('./gulp.conf');
Matteo Scandoloa4a47112016-12-16 10:06:13 -08002const pkg = require('../package.json');
Matteo Scandolod819c922016-12-02 14:06:14 -08003
4module.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 Scandoloa4a47112016-12-16 10:06:13 -080014 'PhantomJS',
Matteo Scandoloe2643b92017-01-31 14:40:33 -080015 'Chrome'
Matteo Scandolod819c922016-12-02 14:06:14 -080016 ],
17 frameworks: [
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080018 'jasmine',
19 'es6-shim'
Matteo Scandolod819c922016-12-02 14:06:14 -080020 ],
21 files: [
22 'node_modules/es6-shim/es6-shim.js',
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080023 conf.path.src('index.spec.js'),
24 conf.path.src('**/*.html')
Matteo Scandolod819c922016-12-02 14:06:14 -080025 ],
26 preprocessors: {
27 [conf.path.src('index.spec.js')]: [
28 'webpack'
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080029 ],
30 [conf.path.src('**/*.html')]: [
31 'ng-html2js'
Matteo Scandolod819c922016-12-02 14:06:14 -080032 ]
33 },
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080034 ngHtml2JsPreprocessor: {
35 stripPrefix: `${conf.paths.src}/`
36 },
Matteo Scandolo40f8fa92016-12-07 09:21:35 -080037 reporters: ['mocha', 'coverage'],
Matteo Scandolod819c922016-12-02 14:06:14 -080038 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 Scandolo40f8fa92016-12-07 09:21:35 -080050 require('karma-phantomjs-launcher'),
Matteo Scandoloa4a47112016-12-16 10:06:13 -080051 require('karma-chrome-launcher'),
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080052 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 Scandolod819c922016-12-02 14:06:14 -080057 ]
58 };
59
60 config.set(configuration);
61};