-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathkarma.conf.js
More file actions
153 lines (125 loc) · 7.17 KB
/
karma.conf.js
File metadata and controls
153 lines (125 loc) · 7.17 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/******************************************************************************
Copyright:: 2020- IBM, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*****************************************************************************/
const path = require("path");
let webpackConfig = require("./webpack-debug.config");
delete webpackConfig.output;
webpackConfig.module.rules[0].options = {
configFile: "tsconfig-nodeclare.json"
}
webpackConfig.module.rules.push({
test: /\.ts$/,
exclude: [path.resolve(__dirname, "test")],
enforce: 'post',
use: {
loader: 'coverage-istanbul-loader',
options: { esModules: true }
}
})
module.exports = (config) => {
config.set({
// ... normal karma configuration
files: [
// { pattern: 'test/v2/checker/accessibility/rules/HAAC_Video_HasNoTrack_ruleunit/Video-HasTrackAndKindWithcaption.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/HAAC_Video_HasNoTrack_ruleunit/Video-HasTrackAndKindWithcaptionDynamic.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/HAAC_Video_HasNoTrack_ruleunit/Video-HasTrackAndKindWithSubtitles.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/WCAG20_Input_ExplicitLabel_ruleunit/ImgRoleButtonAlt.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/WCAG20_Table_CapSummRedundant_ruleunit/*.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/Rpt_Aria_RequiredParent_Native_Host_Sematics_ruleunit/ACT_ff89c9_pass4.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/aria_role_valid_ruleunit/td_attribute_invalid_copy.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/text_block_heading_ruleunit/Headings-noneUsedEmphasizedText.html', watched: true },
//{ pattern: 'test/v2/checker/accessibility/rules/aria_landmark_name_unique_ruleunit/*.html', watched: true },
// { pattern: 'test/v2/checker/accessibility/rules/aria_parent_required_ruleunit/webComponentPass2.html', watched: true },
{ pattern: 'test/**/*_ruleunit/*.html', watched: true },
{ pattern: 'test/**/*_ruleunit/*.htm', watched: true },
// all files ending in "_test"
// { pattern: 'test/*_test.js', watched: true },
{ pattern: 'test/**/*_test.js', watched: true }
// each file acts as entry point for the webpack configuration
],
exclude: [
//Disable - due to a defect that needs to be addressed regarding visibility.
'test/v2/checker/accessibility/rules/a_text_purpose_ruleunit/A-hasTextEmbedded.html',
// disable because the rule is turned off
'test/v2/checker/accessibility/rules/style_before_after_review_ruleunit/*'
],
frameworks: ['jasmine'],
browsers: ['ChromeCustom'],
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
flags: ['--disable-web-security', '--no-sandbox']
}
},
preprocessors: {
'test/**/*_ruleunit/*.html': ['html2js'],
'test/**/*_ruleunit/*.htm': ['html2js'],
// add webpack as preprocessor
'test/*_test.js': ['webpack'],
'test/**/*_test.js': ['webpack']
},
reporters: ["spec", "coverage-istanbul"],
specReporter: {
maxLogLines: 5, // limit number of lines logged per test
suppressErrorSummary: false, // do not print error summary
suppressFailed: false, // do not print information about failed tests
suppressPassed: true, // do not print information about passed tests
suppressSkipped: true, // do not print information about skipped tests
showSpecTiming: true, // print the time elapsed for each spec
failFast: false // test would finish with error when a first fail occurs.
},
webpack: webpackConfig,
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
stats: 'errors-only'
},
coverageIstanbulReporter: {
reports: ['html', 'text-summary'],
dir: path.join(__dirname, 'coverage'),
fixWebpackSourcePaths: true,
'report-config': {
html: { outdir: 'html' }
}
},
// The client configuration options that are available to be set for the karma test.
// Additional information at: http://karma-runner.github.io/0.13/config/configuration-file.html
client: {
// Uses to specific if the testcases should be run in an iframe or not
useIframe: true,
// Used to specific if the console should be captured and piped to terminal
captureConsole: true,
// Used to clear the context window after tunning a test
clearContext: true
},
// web server port
port: 9876,
// Hostname for which the karma server will start on
hostname: "localhost",
// Set an extreamly high number of disconnections tolerated
browserDisconnectTolerance: 2,
// How long does Karma wait for a browser to reconnect (in ms).
browserDisconnectTimeout: 2000,
// How long will Karma wait for a message from a browser before disconnecting from it (in ms).
browserNoActivityTimeout: 100000,
// Timeout for capturing a browser (in ms).
captureTimeout: 60000,
// When a browser crashes, karma will try to relaunch. This defines how many times karma should relaunch a browser before giving up.
retryLimit: 3,
// enable / disable colors in the output (reporters and logs)
colors: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
});
};