forked from siemens/element
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.shared.cjs
More file actions
78 lines (76 loc) · 2.01 KB
/
Copy pathkarma.shared.cjs
File metadata and controls
78 lines (76 loc) · 2.01 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const headless = process.env.HEADLESS !== '0';
const seed = process.env.SEED;
const isCI = !!process.env.CI;
const isPW = !!process.env.PLAYWRIGHT_CONTAINER || !!process.env.PLAYWRIGHT;
const isFirefox = process.env.FIREFOX === '1';
const launcher =
isCI || isPW
? require('./karma-playwright-launcher.cjs')
: isFirefox
? require('karma-firefox-launcher')
: require('karma-chrome-launcher');
const browsers =
isCI || isPW
? ['PlaywrightChromiumHeadless', 'PlaywrightFirefoxHeadless']
: headless
? isFirefox
? ['FirefoxHeadless']
: ['ChromeHeadlessBigger']
: isFirefox
? ['Firefox']
: ['Chrome'];
module.exports.buildConfig = (config, { name, testSuite }) => ({
basePath: '',
hostname: 'localhost',
frameworks: ['jasmine'],
plugins: [
require('karma-jasmine'),
launcher,
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('karma-junit-reporter'),
require('karma-spec-reporter'),
require('karma-jasmine-seed-reporter')
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
jasmine: {
seed
}
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, `./dist/coverage/${name}`),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'cobertura' }, { type: 'text-summary' }],
check: {
global: {
lines: 90
}
}
},
junitReporter: {
outputDir: require('path').join(__dirname, `./dist/reports/${name}`),
suite: testSuite
},
specReporter: {
suppressPassed: isCI,
suppressSkipped: true
},
reporters: ['spec', 'kjhtml', 'junit', 'jasmine-seed'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: !isCI,
customLaunchers: {
ChromeHeadlessBigger: {
base: 'ChromeHeadless',
flags: ['--window-size=1024,768']
}
},
browsers,
singleRun: isCI,
browserNoActivityTimeout: 100000
});