blob: 2db61329e1a0d39e90e3977a2a14e486572ef64e [file] [log] [blame]
Matteo Scandolofc4b37b2017-02-02 12:18:47 -08001const conf = require('./gulp.conf');
2
3module.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: [
16 'jasmine',
17 'es6-shim'
18 ],
19 files: [
20 'node_modules/es6-shim/es6-shim.js',
21 conf.path.src('index.spec.js'),
22 conf.path.src('**/*.html')
23 ],
24 preprocessors: {
25 [conf.path.src('index.spec.js')]: [
26 'webpack'
27 ],
28 [conf.path.src('**/*.html')]: [
29 'ng-html2js'
30 ]
31 },
32 ngHtml2JsPreprocessor: {
33 stripPrefix: `${conf.paths.src}/`
34 },
35 reporters: ['progress', 'coverage'],
36 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'),
48 require('karma-phantomjs-launcher'),
49 require('karma-phantomjs-shim'),
50 require('karma-ng-html2js-preprocessor'),
51 require('karma-webpack'),
52 require('karma-es6-shim')
53 ]
54 };
55
56 config.set(configuration);
57};