This repository has been archived by the owner on May 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
49 lines (48 loc) · 1.98 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const webpackConfig = require('./config/webpack.karma.config');
module.exports = function(config) {
config.set({
basePath: '',
singleRun: true,
files: [
'test/**/*.spec.js'
],
reporters: ['mocha', 'junit'],
preprocessors: {
'test/**/*.spec.js': ['webpack', 'sourcemap']
},
browsers: ['Compass'],
frameworks: ['mocha', 'chai', 'sinon', 'chai-sinon'],
webpack: webpackConfig,
webpackMiddleware: { noInfo: true, stats: 'errors-only' },
// DEV: `useIframe: false` is for launching a new window instead of using an iframe
// In Electron, iframes don't get `nodeIntegration` priveleges yet windows do.
client: { useIframe: false },
logLevel: config.LOG_ERROR,
/**
* Define a custom launcher which inherits from `Electron`
* @see https://github.com/mongodb-js/compass-connect/pull/82
* @see https://github.com/twolfson/karma-electron#forcing-nodeintegration-support
*/
customLaunchers: {
Compass: {
base: 'Electron',
browserWindowOptions: {
webPreferences: {
nodeIntegration: true
}
}
}
},
junitReporter: {
outputDir: 'coverage', // results will be saved as $outputDir/$browserName.xml
outputFile: 'karma-results.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
useBrowserName: false, // add browser name to report and classes names
// the default configuration
suite: '', // suite will become the package name attribute in xml testsuite element
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {}, // key value pair of properties to add to the <properties> section of the report
xmlVersion: null // use '1' if reporting to be per SonarQube 6.2 XML format
}
});
};