Skip to content

Commit aa1aaef

Browse files
committed
comment & lint in karma conf
- Chrome is now used on CI - highlight that --ignore-gpu-blacklist allow to test WebGL on CI (CircleCI already wraps the process with xfvb) - DRY files array operations
1 parent 0e3c61f commit aa1aaef

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

test/jasmine/karma.conf.js

+13-16
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func.defaultConfig = {
6161
// N.B. this field is filled below
6262
files: [],
6363

64+
// list of files / pattern to exclude
6465
exclude: [],
6566

6667
// preprocess matching files before serving them to the browser
@@ -98,7 +99,10 @@ func.defaultConfig = {
9899
browsers: ['Chrome_WindowSized'],
99100

100101
// custom browser options
102+
//
101103
// window-size values came from observing default size
104+
//
105+
// '--ignore-gpu-blacklist' allow to test WebGL on CI (!!!)
102106
customLaunchers: {
103107
Chrome_WindowSized: {
104108
base: 'Chrome',
@@ -122,41 +126,34 @@ func.defaultConfig = {
122126
// to avoid import conflicts due to plotly.js
123127
// circular dependencies.
124128
if(isSingleSuiteRun) {
125-
func.defaultConfig.files = [
129+
func.defaultConfig.files.push(
126130
pathToJQuery,
127-
pathToMain,
128-
testFileGlob
129-
];
131+
pathToMain
132+
);
130133

131134
func.defaultConfig.preprocessors[pathToMain] = ['browserify'];
132135
func.defaultConfig.preprocessors[testFileGlob] = ['browserify'];
133136
}
134137
else if(isRequireJSTest) {
135138
func.defaultConfig.files = [
136139
constants.pathToRequireJS,
137-
constants.pathToRequireJSFixture,
138-
testFileGlob
140+
constants.pathToRequireJSFixture
139141
];
140142
}
141143
else if(isIE9Test) {
142144
// load ie9_mock.js before plotly.js+test bundle
143145
// to catch reference errors that could occur
144146
// when plotly.js is first loaded.
145147

146-
func.defaultConfig.files = [
147-
'./assets/ie9_mock.js',
148-
testFileGlob
149-
];
150-
148+
func.defaultConfig.files.push('./assets/ie9_mock.js');
151149
func.defaultConfig.preprocessors[testFileGlob] = ['browserify'];
152150
}
153151
else {
154-
func.defaultConfig.files = [
155-
pathToJQuery,
156-
testFileGlob
157-
];
158-
152+
func.defaultConfig.files.push(pathToJQuery);
159153
func.defaultConfig.preprocessors[testFileGlob] = ['browserify'];
160154
}
161155

156+
// lastly, load test file glob
157+
func.defaultConfig.files.push(testFileGlob);
158+
162159
module.exports = func;

0 commit comments

Comments
 (0)