blob: 72132d9c79fdfd0646b95e80e60e4d778b020205 [file] [log] [blame]
Matteo Scandolo686547a2017-08-08 13:05:25 -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 Scandoloa5d03d52016-07-21 11:35:46 -070019/*eslint-env node */
20(function () {
21
22 'use strict';
23
24 // Karma configuration
25 // Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
26
27 const babelPreset = require('babel-preset-es2015');
28
29 /*eslint-disable*/
30
31 var files = [
32 'node_modules/babel-polyfill/dist/polyfill.js',
33
34
35 // loading jquery (it's used in tests)
36 `./bower_components/jquery/dist/jquery.js`,
37 `./bower_components/jasmine-jquery/lib/jasmine-jquery.js`,
38
39 // loading helpers and vendors
40 `./dist/ngXosVendor.min.js`,
41 `./dist/xosUiComponents.js`,
42
43 // loading ngMock
44 `./bower_components/angular-mocks/angular-mocks.js`,
45 ]
46 .concat([
47 // loading tests
48 `spec/test_helpers.js`,
49 `spec/ui/xos.helpers.mock.js`,
50 'spec/ui/**/*.test.js'
51 ]);
52
53 module.exports = function(config) {
54 /*eslint-enable*/
55 config.set({
56
57 // base path that will be used to resolve all patterns (eg. files, exclude)
58 basePath: '',
59
60
61 // frameworks to use
62 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
63 frameworks: ['jasmine'],
64
65
66 // list of files / patterns to load in the browser
67 files: files,
68
69
70 // list of files to exclude
71 exclude: [
72 ],
73
74
75 // preprocess matching files before serving them to the browser
76 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
77 preprocessors: {
78 './spec/ui/**/*.test.js': ['babel'],
79 './spec/test_helpers.js': ['babel'],
80 './spec/ui/xos.helpers.mock.js': ['babel']
81 },
82
83 babelPreprocessor: {
84 options: {
85 presets: [babelPreset],
86 sourceMap: 'inline'
87 }
88 },
89
90 //ngHtml2JsPreprocessor: {
91 // stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
92 // moduleName: 'templates' // define the template module name
93 //},
94
95 // test results reporter to use
96 // possible values: 'dots', 'progress'
97 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
Matteo Scandolo0856e652016-07-22 11:24:22 -070098 reporters: ['dots'],
Matteo Scandoloa5d03d52016-07-21 11:35:46 -070099
100 // web server port
101 port: 9876,
102
103
104 // enable / disable colors in the output (reporters and logs)
105 colors: true,
106
107
108 // level of logging
109 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
110 logLevel: config.LOG_INFO,
111
112
113 // enable / disable watching file and executing tests whenever any file changes
114 autoWatch: false,
115
116
117 // start these browsers
118 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
119 browsers: [
120 'PhantomJS',
121 // 'Chrome'
122 ],
123
124
125 // Continuous Integration mode
126 // if true, Karma captures browsers, runs the tests and exits
127 singleRun: true
128 });
129 };
130
131})();