Skip to content

Commit 88c0a27

Browse files
author
Andrey Fel
committed
Autofix linter errors
`yarn lint:js --fix`
1 parent 35cd64c commit 88c0a27

33 files changed

Lines changed: 370 additions & 387 deletions

.stylelintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
module.exports = {
44
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
55
rules: {
6-
"selector-class-pattern": null,
7-
}
6+
'selector-class-pattern': null,
7+
},
88
};

addon-test-support/-private/async-iterator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default class AsyncIterator {
5151
handleResponse(response) {
5252
if (this._waiting === false) {
5353
throw new Error(
54-
`${this.toString()} Was not expecting a response, but got a response`
54+
`${this.toString()} Was not expecting a response, but got a response`,
5555
);
5656
} else {
5757
this._waiting = false;
@@ -82,7 +82,7 @@ export default class AsyncIterator {
8282
this._done = true;
8383
this._testem.removeEventCallbacks(
8484
this._response,
85-
this._boundHandleResponse
85+
this._boundHandleResponse,
8686
);
8787
}
8888

@@ -111,13 +111,13 @@ export default class AsyncIterator {
111111

112112
if (this._emberExamExitOnError) {
113113
let err = new Error(
114-
`EmberExam: Promise timed out after ${this._timeout} s while waiting for response for ${this._request}`
114+
`EmberExam: Promise timed out after ${this._timeout} s while waiting for response for ${this._request}`,
115115
);
116116
reject(err);
117117
} else {
118118
// eslint-disable-next-line no-console
119119
console.error(
120-
`EmberExam: Promise timed out after ${this._timeout} s while waiting for response for ${this._request}. Closing browser to exit gracefully.`
120+
`EmberExam: Promise timed out after ${this._timeout} s while waiting for response for ${this._request}. Closing browser to exit gracefully.`,
121121
);
122122
resolve(iteratorCompleteResponse);
123123
}

addon-test-support/-private/ember-exam-mocha-test-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default class EmberExamMochaTestLoader extends TestLoader {
7474
this._testModules = filterTestModules(
7575
this._testModules,
7676
modulePath,
77-
filePath
77+
filePath,
7878
);
7979
}
8080

addon-test-support/-private/ember-exam-qunit-test-loader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default class EmberExamQUnitTestLoader extends TestLoader {
8282
this._testModules = filterTestModules(
8383
this._testModules,
8484
modulePath,
85-
filePath
85+
filePath,
8686
);
8787
}
8888

@@ -91,18 +91,18 @@ export default class EmberExamQUnitTestLoader extends TestLoader {
9191
this._testModules = splitTestModules(
9292
weightTestModules(this._testModules),
9393
split,
94-
partitions
94+
partitions,
9595
);
9696
this._testem.emit(
9797
'testem:set-modules-queue',
9898
this._testModules,
99-
browserId
99+
browserId,
100100
);
101101
} else {
102102
this._testModules = splitTestModules(
103103
this._testModules,
104104
split,
105-
partitions
105+
partitions,
106106
);
107107
this._testModules.forEach((moduleName) => {
108108
super.require(moduleName);
@@ -120,7 +120,7 @@ export default class EmberExamQUnitTestLoader extends TestLoader {
120120
loadIndividualModule(moduleName) {
121121
if (moduleName === undefined) {
122122
throw new Error(
123-
'Failed to load a test module. `moduleName` is undefined in `loadIndividualModule`.'
123+
'Failed to load a test module. `moduleName` is undefined in `loadIndividualModule`.',
124124
);
125125
}
126126
super.require(moduleName);

addon-test-support/-private/filter-test-modules.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function wildcardFilter(module, moduleFilter) {
4141
function stringFilter(modules, moduleFilter) {
4242
return modules.filter(
4343
(module) =>
44-
module.includes(moduleFilter) || wildcardFilter(module, moduleFilter)
44+
module.includes(moduleFilter) || wildcardFilter(module, moduleFilter),
4545
);
4646
}
4747

@@ -57,7 +57,7 @@ function regexFilter(modules, modulePathRegexFilter) {
5757
const exclude = modulePathRegexFilter[1];
5858

5959
return modules.filter(
60-
(module) => (!exclude && re.test(module)) || (exclude && !re.test(module))
60+
(module) => (!exclude && re.test(module)) || (exclude && !re.test(module)),
6161
);
6262
}
6363

@@ -98,21 +98,21 @@ function filterTestModules(modules, modulePath, filePath) {
9898
if (modulePathRegex) {
9999
return result.concat(
100100
regexFilter(modules, modulePathRegex).filter(
101-
(module) => result.indexOf(module) === -1
102-
)
101+
(module) => result.indexOf(module) === -1,
102+
),
103103
);
104104
} else {
105105
return result.concat(
106106
stringFilter(modules, modulePath).filter(
107-
(module) => result.indexOf(module) === -1
108-
)
107+
(module) => result.indexOf(module) === -1,
108+
),
109109
);
110110
}
111111
}, []);
112112

113113
if (filteredTestModules.length === 0) {
114114
throw new Error(
115-
`No tests matched with the filter: ${modulePath || filePath}.`
115+
`No tests matched with the filter: ${modulePath || filePath}.`,
116116
);
117117
}
118118
return filteredTestModules;

addon-test-support/-private/get-test-loader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ import {
1414
export default function getTestLoader() {
1515
if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
1616
const EmberExamQUnitTestLoader = importSync(
17-
'./ember-exam-qunit-test-loader'
17+
'./ember-exam-qunit-test-loader',
1818
);
1919
return EmberExamQUnitTestLoader['default'];
2020
} else if (macroCondition(dependencySatisfies('ember-mocha', '*'))) {
2121
const EmberExamMochaTestLoader = importSync(
22-
'./ember-exam-mocha-test-loader'
22+
'./ember-exam-mocha-test-loader',
2323
);
2424
return EmberExamMochaTestLoader['default'];
2525
}
2626

2727
throw new Error(
28-
'Unable to find a suitable test loader. You should ensure that one of `ember-qunit` or `ember-mocha` are added as dependencies.'
28+
'Unable to find a suitable test loader. You should ensure that one of `ember-qunit` or `ember-mocha` are added as dependencies.',
2929
);
3030
}

addon-test-support/-private/split-test-modules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ export default function splitTestModules(modules, split, partitions) {
4343
throw new Error(
4444
"You must specify numbers for partition (you specified '" +
4545
partitions +
46-
"')"
46+
"')",
4747
);
4848
}
4949

5050
if (split < partition) {
5151
throw new Error(
5252
'You must specify partitions numbered less than or equal to your split value of ' +
53-
split
53+
split,
5454
);
5555
} else if (partition < 1) {
5656
throw new Error('You must specify partitions numbered greater than 0');

addon-test-support/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
function loadTests(testLoader) {
1515
if (testLoader === undefined) {
1616
throw new Error(
17-
'A testLoader instance has not been created. You must call `loadEmberExam()` before calling `loadTest()`.'
17+
'A testLoader instance has not been created. You must call `loadEmberExam()` before calling `loadTest()`.',
1818
);
1919
}
2020

lib/commands/exam.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ module.exports = TestCommand.extend({
126126
const validator = new Validator(
127127
commandOptions,
128128
this._getTestFramework(),
129-
this.emberCliVersion
129+
this.emberCliVersion,
130130
);
131131
return validator.validateCommands();
132132
},
@@ -163,21 +163,21 @@ module.exports = TestCommand.extend({
163163
commandOptions.query = addToQuery(
164164
commandOptions.query,
165165
'split',
166-
commandOptions.split
166+
commandOptions.split,
167167
);
168168

169169
process.env.EMBER_EXAM_SPLIT_COUNT = commandOptions.split;
170170

171171
// Ignore the partition option when paralleling (we'll fill it in later)
172172
if (!commandOptions.parallel && commandOptions.partition) {
173173
const partitions = combineOptionValueIntoArray(
174-
commandOptions.partition
174+
commandOptions.partition,
175175
);
176176
for (let i = 0; i < partitions.length; i++) {
177177
commandOptions.query = addToQuery(
178178
commandOptions.query,
179179
'partition',
180-
partitions[i]
180+
partitions[i],
181181
);
182182
}
183183
}
@@ -187,44 +187,44 @@ module.exports = TestCommand.extend({
187187
commandOptions.query = addToQuery(
188188
commandOptions.query,
189189
'modulePath',
190-
commandOptions.modulePath
190+
commandOptions.modulePath,
191191
);
192192
}
193193

194194
if (commandOptions.preserveTestName) {
195195
commandOptions.query = addToQuery(
196196
commandOptions.query,
197197
'preserveTestName',
198-
commandOptions.preserveTestName
198+
commandOptions.preserveTestName,
199199
);
200200
}
201201

202202
if (commandOptions.filePath) {
203203
commandOptions.query = addToQuery(
204204
commandOptions.query,
205205
'filePath',
206-
commandOptions.filePath
206+
commandOptions.filePath,
207207
);
208208
}
209209

210210
if (commandOptions.loadBalance) {
211211
commandOptions.query = addToQuery(
212212
commandOptions.query,
213213
'loadBalance',
214-
commandOptions.loadBalance
214+
commandOptions.loadBalance,
215215
);
216216
}
217217

218218
if (commandOptions.replayBrowser) {
219219
commandOptions.replayBrowser = combineOptionValueIntoArray(
220-
commandOptions.replayBrowser
220+
commandOptions.replayBrowser,
221221
);
222222
}
223223

224224
if (typeof commandOptions.random !== 'undefined') {
225225
commandOptions.query = this._randomize(
226226
commandOptions.random,
227-
commandOptions.query
227+
commandOptions.query,
228228
);
229229
}
230230

@@ -266,14 +266,14 @@ module.exports = TestCommand.extend({
266266
isReplayExecution: this.commands.get('replayExecution'),
267267
isWriteExecutionFile: this.commands.get('writeExecutionFile'),
268268
},
269-
this.testemEvents
269+
this.testemEvents,
270270
);
271271
additionalEvents = Object.assign(additionalEvents, loadBalancingEvents);
272272
}
273273

274274
config.custom_browser_socket_events = Object.assign(
275275
config.custom_browser_socket_events || {},
276-
additionalEvents
276+
additionalEvents,
277277
);
278278

279279
if (
@@ -288,7 +288,7 @@ module.exports = TestCommand.extend({
288288
if (commandOptions.replayExecution) {
289289
this.testemEvents.setReplayExecutionMap(
290290
commandOptions.replayExecution,
291-
commandOptions.replayBrowser
291+
commandOptions.replayBrowser,
292292
);
293293
}
294294

@@ -312,7 +312,7 @@ module.exports = TestCommand.extend({
312312
log.info(
313313
`Browser ${browserId} exiting. [ # of modules in current module queue ${
314314
testemEvents.stateManager.getTestModuleQueue().length
315-
} ]`
315+
} ]`,
316316
);
317317
// if getBrowserId cannot get the browserId
318318
// but the test queue is not empty, report the number of test modules left in the queue
@@ -322,7 +322,7 @@ module.exports = TestCommand.extend({
322322
ui.writeLine(
323323
`[ # of modules in current module queue ${
324324
testemEvents.stateManager.getTestModuleQueue().length
325-
} ]`
325+
} ]`,
326326
);
327327
} else {
328328
throw new Error('testModuleQueue is not set.');
@@ -343,7 +343,7 @@ module.exports = TestCommand.extend({
343343
launcherId,
344344
ui,
345345
commands,
346-
Date.now()
346+
Date.now(),
347347
);
348348
};
349349

@@ -370,7 +370,7 @@ module.exports = TestCommand.extend({
370370

371371
return this._getModuleMetadataAndBrowserExitSocketEvents(
372372
browserExitHandler,
373-
browserTerminationHandler
373+
browserTerminationHandler,
374374
);
375375
},
376376

@@ -382,7 +382,7 @@ module.exports = TestCommand.extend({
382382
*/
383383
_getModuleMetadataAndBrowserExitSocketEvents(
384384
browserExitHandler,
385-
browserTerminationHandler
385+
browserTerminationHandler,
386386
) {
387387
const events = {};
388388
const testemEvents = this.testemEvents;
@@ -442,7 +442,7 @@ module.exports = TestCommand.extend({
442442
*/
443443
_getLoadBalancingBrowserSocketEvents(
444444
{ isLoadBalance, isReplayExecution, isWriteExecutionFile },
445-
testemEvents
445+
testemEvents,
446446
) {
447447
const events = {};
448448
const ui = this.ui;
@@ -452,14 +452,14 @@ module.exports = TestCommand.extend({
452452
browserId,
453453
modules,
454454
isLoadBalance,
455-
isReplayExecution
455+
isReplayExecution,
456456
);
457457
};
458458
events['testem:next-module-request'] = function (browserId) {
459459
testemEvents.nextModuleResponse(
460460
browserId,
461461
this.socket,
462-
isWriteExecutionFile
462+
isWriteExecutionFile,
463463
);
464464
};
465465
events['test-result'] = function (result) {

lib/commands/exam/iterate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = {
8585
execa.sync(
8686
'./node_modules/.bin/ember',
8787
['build', '--output-path', `${this._outputDir}`],
88-
['stdio', 'inherit']
88+
['stdio', 'inherit'],
8989
);
9090
},
9191

0 commit comments

Comments
 (0)