Repository navigation
Expand file tree
/
Copy pathkarma.conf.js
More file actions
75 lines (65 loc) · 2.51 KB
/
Copy pathkarma.conf.js
File metadata and controls
75 lines (65 loc) · 2.51 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
// @ts-check
/**
* Karma configuration for the ih-hand-sanitation-www Angular project.
*
* Runner : Karma v6 + karma-jasmine
* Browser: ChromeHeadless (swap to Chrome for interactive debug)
* Coverage: istanbul via karma-coverage
*
* Docs: https://karma-runner.github.io/6.4/config/configuration-file.html
*/
/** @param {import('karma').Config} config */
module.exports = function (config) {
config.set({
// Base path used to resolve all relative file patterns.
basePath: '',
// Use Jasmine as the test framework.
frameworks: ['jasmine', '@angular-devkit/build-angular'],
// Reporters active during a run.
reporters: ['progress', 'kjhtml', 'coverage'],
// -------------------------------------------------------------------------
// Coverage reporter
// -------------------------------------------------------------------------
coverageReporter: {
/** Output directory relative to basePath. */
dir: 'coverage',
reporters: [
{ type: 'html', subdir: 'html' }, // browse coverage/html/index.html
{ type: 'lcovonly', subdir: '.', file: 'lcov.info' }, // for CI tools
{ type: 'text-summary' }, // printed to console after run
],
},
// -------------------------------------------------------------------------
// Browsers
// -------------------------------------------------------------------------
/**
* 'ChromeHeadless' - suitable for CI (no display server needed).
* Override at the command line for local interactive debugging:
* ng test --browsers=Chrome
*/
browsers: ['Chrome'],
customLaunchers: {
/** Headless Chrome configuration used in CI pipelines. */
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--disable-gpu'],
},
},
// -------------------------------------------------------------------------
// Run behaviour
// -------------------------------------------------------------------------
/** Single run in CI; set to true for 'ng test --watch'. */
singleRun: false,
/** Restart on source change when not in single-run mode. */
autoWatch: true,
/**
* Increase timeout for slow machines or heavy test suites.
* Default is 10 000 ms.
*/
browserNoActivityTimeout: 30000,
// -------------------------------------------------------------------------
// Misc
// -------------------------------------------------------------------------
logLevel: config.LOG_INFO,
});
};