blob: 07eecf8697abccedece1ea0c182c984cd74bd037 [file] [log] [blame]
Matteo Scandolofb46ae62017-08-08 09:10:50 -07001
2/*
3 * Copyright 2017-present Open Networking Foundation
4
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
Matteo Scandolod819c922016-12-02 14:06:14 -080019const conf = require('./gulp.conf');
20
21module.exports = function (config) {
22 const configuration = {
23 basePath: '../',
24 singleRun: true,
25 autoWatch: false,
26 logLevel: 'INFO',
27 junitReporter: {
28 outputDir: 'test-reports'
29 },
30 browsers: [
31 'PhantomJS'
32 ],
33 frameworks: [
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080034 'jasmine',
35 'es6-shim'
Matteo Scandolod819c922016-12-02 14:06:14 -080036 ],
37 files: [
38 'node_modules/es6-shim/es6-shim.js',
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080039 conf.path.src('index.spec.js'),
40 conf.path.src('**/*.html')
Matteo Scandolod819c922016-12-02 14:06:14 -080041 ],
42 preprocessors: {
43 [conf.path.src('index.spec.js')]: [
44 'webpack'
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080045 ],
46 [conf.path.src('**/*.html')]: [
47 'ng-html2js'
Matteo Scandolod819c922016-12-02 14:06:14 -080048 ]
49 },
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080050 ngHtml2JsPreprocessor: {
51 stripPrefix: `${conf.paths.src}/`
52 },
Matteo Scandolod819c922016-12-02 14:06:14 -080053 reporters: ['progress', 'coverage'],
54 coverageReporter: {
Matteo Scandolo70377e52017-04-10 16:41:28 -070055 // type: 'html',
56 dir: 'coverage/',
57 reporters: [
58 {type: 'json', subdir: '.'},
59 {type: 'html', subdir: 'html'},
60 {type: 'cobertura', subdir: '.'}
61 ]
Matteo Scandolod819c922016-12-02 14:06:14 -080062 },
63 webpack: require('./webpack-test.conf'),
64 webpackMiddleware: {
65 noInfo: true
66 },
67 plugins: [
68 require('karma-jasmine'),
69 require('karma-junit-reporter'),
70 require('karma-coverage'),
71 require('karma-phantomjs-launcher'),
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080072 require('karma-phantomjs-shim'),
73 require('karma-ng-html2js-preprocessor'),
74 require('karma-webpack'),
75 require('karma-es6-shim')
Matteo Scandolod819c922016-12-02 14:06:14 -080076 ]
77 };
78
79 config.set(configuration);
80};