Skip to content

Commit 70cf732

Browse files
committed
Eslint fix
1 parent e11dddf commit 70cf732

File tree

6 files changed

+103
-92
lines changed

6 files changed

+103
-92
lines changed

packages/app/src/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export class WebdriverIODevtoolsApplication extends Element {
5252
connectedCallback(): void {
5353
super.connectedCallback()
5454
window.addEventListener('load-trace', this.#loadTrace.bind(this))
55-
this.addEventListener('clear-execution-data', this.#clearExecutionData.bind(this))
55+
this.addEventListener(
56+
'clear-execution-data',
57+
this.#clearExecutionData.bind(this)
58+
)
5659
}
5760

5861
render() {

packages/app/src/components/sidebar/explorer.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
124124
}
125125

126126
// Clear execution data before triggering rerun
127-
this.dispatchEvent(new CustomEvent('clear-execution-data', { bubbles: true, composed: true }))
127+
this.dispatchEvent(
128+
new CustomEvent('clear-execution-data', { bubbles: true, composed: true })
129+
)
128130

129131
const payload = {
130132
...detail,
@@ -133,7 +135,6 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
133135
specFile: detail.specFile || this.#deriveSpecFile(detail),
134136
configFile: this.#getConfigPath()
135137
}
136-
console.log('[Explorer] Sending test run request:', payload)
137138
await this.#postToBackend('/api/tests/run', payload)
138139
}
139140

@@ -199,7 +200,9 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
199200
}
200201

201202
// Clear execution data before triggering rerun
202-
this.dispatchEvent(new CustomEvent('clear-execution-data', { bubbles: true, composed: true }))
203+
this.dispatchEvent(
204+
new CustomEvent('clear-execution-data', { bubbles: true, composed: true })
205+
)
203206

204207
void this.#postToBackend('/api/tests/run', {
205208
uid: '*',
@@ -327,9 +330,11 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
327330
return (
328331
Boolean(
329332
['all', 'none'].includes(this.#testFilter.filterStatus) ||
330-
(entry.state === TestState.PASSED && this.#testFilter.filtersPassed) ||
331-
(entry.state === TestState.FAILED && this.#testFilter.filtersFailed) ||
332-
(entry.state === TestState.SKIPPED && this.#testFilter.filtersSkipped)
333+
(entry.state === TestState.PASSED &&
334+
this.#testFilter.filtersPassed) ||
335+
(entry.state === TestState.FAILED &&
336+
this.#testFilter.filtersFailed) ||
337+
(entry.state === TestState.SKIPPED && this.#testFilter.filtersSkipped)
333338
) &&
334339
(!this.#testFilter.filterQuery ||
335340
entryLabelIncludingChildren

packages/app/src/controller/DataManager.ts

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,21 @@ export class DataManagerController implements ReactiveController {
187187
: ([data] as Record<string, SuiteStatsFragment>[])
188188

189189
for (const chunk of payloads) {
190-
if (!chunk) continue
190+
if (!chunk) {
191+
continue
192+
}
191193

192194
for (const suite of Object.values(chunk)) {
193-
if (!suite?.start) continue
195+
if (!suite?.start) {
196+
continue
197+
}
194198

195-
const suiteStartTime = suite.start instanceof Date
196-
? suite.start.getTime()
197-
: (typeof suite.start === 'number' ? suite.start : 0)
199+
const suiteStartTime =
200+
suite.start instanceof Date
201+
? suite.start.getTime()
202+
: typeof suite.start === 'number'
203+
? suite.start
204+
: 0
198205

199206
// New run detected if we see a newer start timestamp
200207
if (suiteStartTime > this.#lastSeenRunTimestamp) {
@@ -264,46 +271,44 @@ export class DataManagerController implements ReactiveController {
264271

265272
const suiteMap = new Map<string, SuiteStatsFragment>()
266273

267-
console.log('[DataManager] Suites update - existing suites:', this.suitesContextProvider.value?.length || 0)
268-
269274
// Populate with existing suites (keeps test list visible)
270275
;(this.suitesContextProvider.value || []).forEach((chunk) => {
271276
Object.entries(chunk as Record<string, SuiteStatsFragment>).forEach(
272277
([uid, suite]) => {
273278
if (suite?.uid) {
274279
suiteMap.set(uid, suite)
275-
console.log('[DataManager] Added existing suite to map:', uid, suite.title)
276280
}
277281
}
278282
)
279283
})
280284

281-
console.log('[DataManager] Incoming payloads:', payloads.length)
282-
283285
// Process incoming payloads
284286
payloads.forEach((chunk) => {
285-
if (!chunk) return
287+
if (!chunk) {
288+
return
289+
}
286290

287291
Object.entries(chunk).forEach(([uid, suite]) => {
288-
if (!suite?.uid) return
292+
if (!suite?.uid) {
293+
return
294+
}
289295

290-
console.log('[DataManager] Processing incoming suite:', uid, suite.title)
291296
const existing = suiteMap.get(uid)
292297

293298
// Always merge to preserve all tests in the suite
294299
suiteMap.set(uid, existing ? this.#mergeSuite(existing, suite) : suite)
295300
})
296301
})
297302

298-
console.log('[DataManager] Final suite map size:', suiteMap.size)
299-
300303
this.suitesContextProvider.setValue(
301304
Array.from(suiteMap.entries()).map(([uid, suite]) => ({ [uid]: suite }))
302305
)
303306
}
304307

305308
#getTimestamp(date: Date | number | undefined): number {
306-
if (!date) return 0
309+
if (!date) {
310+
return 0
311+
}
307312
return date instanceof Date ? date.getTime() : date
308313
}
309314

@@ -330,10 +335,14 @@ export class DataManagerController implements ReactiveController {
330335

331336
// First merge tests and suites properly
332337
const mergedTests = this.#mergeTests(existing.tests, incoming.tests)
333-
const mergedSuites = this.#mergeChildSuites(existing.suites, incoming.suites)
338+
const mergedSuites = this.#mergeChildSuites(
339+
existing.suites,
340+
incoming.suites
341+
)
334342

335343
// Then merge suite properties, ensuring merged tests/suites are preserved
336-
const { tests: _incomingTests, suites: _incomingSuites, ...incomingProps } = incoming
344+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
345+
const { tests, suites, ...incomingProps } = incoming
337346

338347
return {
339348
...existing,
@@ -351,23 +360,24 @@ export class DataManagerController implements ReactiveController {
351360
prev?.forEach((suite) => suite && map.set(suite.uid, suite))
352361

353362
next?.forEach((suite) => {
354-
if (!suite) return
363+
if (!suite) {
364+
return
365+
}
355366
const existing = map.get(suite.uid)
356367
map.set(suite.uid, existing ? this.#mergeSuite(existing, suite) : suite)
357368
})
358369

359370
return Array.from(map.values())
360371
}
361372

362-
#mergeTests(
363-
prev: TestStatsFragment[] = [],
364-
next: TestStatsFragment[] = []
365-
) {
373+
#mergeTests(prev: TestStatsFragment[] = [], next: TestStatsFragment[] = []) {
366374
const map = new Map<string, TestStatsFragment>()
367375
prev?.forEach((test) => test && map.set(test.uid, test))
368376

369377
next?.forEach((test) => {
370-
if (!test) return
378+
if (!test) {
379+
return
380+
}
371381
const existing = map.get(test.uid)
372382

373383
// Check if this test is a rerun (different start time)
@@ -378,7 +388,10 @@ export class DataManagerController implements ReactiveController {
378388
this.#getTimestamp(test.start) !== this.#getTimestamp(existing.start)
379389

380390
// Replace on rerun, merge on normal update
381-
map.set(test.uid, isRerun ? test : existing ? { ...existing, ...test } : test)
391+
map.set(
392+
test.uid,
393+
isRerun ? test : existing ? { ...existing, ...test } : test
394+
)
382395
})
383396

384397
return Array.from(map.values())

packages/backend/src/runner.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,12 @@ const FRAMEWORK_FILTERS: Record<
4545
> = {
4646
cucumber: ({ specArg, payload }) => {
4747
const filters: string[] = []
48-
console.log('[Runner] Cucumber filter - payload:', {
49-
entryType: payload.entryType,
50-
suiteType: payload.suiteType,
51-
featureFile: payload.featureFile,
52-
featureLine: payload.featureLine,
53-
fullTitle: payload.fullTitle,
54-
specArg
55-
})
5648

5749
// For feature-level suites, run the entire feature file
5850
if (payload.suiteType === 'feature' && specArg) {
5951
// Remove any line number from specArg for feature-level execution
6052
const featureFile = specArg.split(':')[0]
6153
filters.push('--spec', featureFile)
62-
console.log('[Runner] Feature-level execution - running entire file:', featureFile)
6354
return filters
6455
}
6556

@@ -84,7 +75,10 @@ const FRAMEWORK_FILTERS: Record<
8475
}
8576
// Use regex to match the exact "rowNumber: scenarioName" pattern
8677
// This ensures we only run that specific example row
87-
filters.push('--cucumberOpts.name', `^${rowNumber}:\\s*${escapeRegex(scenarioName.trim())}$`)
78+
filters.push(
79+
'--cucumberOpts.name',
80+
`^${rowNumber}:\\s*${escapeRegex(scenarioName.trim())}$`
81+
)
8882
return filters
8983
}
9084
// No row number - use plain name filter

packages/service/src/launcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class DevToolsAppLauncher {
4343
this.#updateCapabilities(caps, {
4444
port,
4545
hostname: this.#options.hostname || 'localhost'
46-
})
46+
})
4747
this.#browser = await remote({
4848
automationProtocol: 'devtools',
4949
capabilities: {

0 commit comments

Comments
 (0)