Skip to content

Commit a009ac5

Browse files
committed
Eslint fix
1 parent 1c72547 commit a009ac5

6 files changed

Lines changed: 53 additions & 22 deletions

File tree

example/features/step-definitions/steps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ Then(/^I should see a flash message saying (.*)$/, async (message) => {
2929
const el = await SecurePage.flashAlert
3030
await expect(el).toBeExisting()
3131
await expect(el).toHaveText(expect.stringContaining(message))
32-
console.log(`[TEST] Flash message verified successfully`)
32+
console.log('[TEST] Flash message verified successfully')
3333
// await browser.pause(15000)
3434
})

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,11 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
315315
return (
316316
Boolean(
317317
['all', 'none'].includes(this.#testFilter.filterStatus) ||
318-
(entry.state === TestState.PASSED && this.#testFilter.filtersPassed) ||
319-
(entry.state === TestState.FAILED && this.#testFilter.filtersFailed) ||
320-
(entry.state === TestState.SKIPPED && this.#testFilter.filtersSkipped)
318+
(entry.state === TestState.PASSED &&
319+
this.#testFilter.filtersPassed) ||
320+
(entry.state === TestState.FAILED &&
321+
this.#testFilter.filtersFailed) ||
322+
(entry.state === TestState.SKIPPED && this.#testFilter.filtersSkipped)
321323
) &&
322324
(!this.#testFilter.filterQuery ||
323325
entryLabelIncludingChildren

packages/app/src/components/tabs.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export class DevtoolsTabs extends Element {
2828
]
2929

3030
#getTabButton(tabId: string) {
31-
const tabElement = this.tabs.find((el) => el.getAttribute('label') === tabId)
31+
const tabElement = this.tabs.find(
32+
(el) => el.getAttribute('label') === tabId
33+
)
3234
const badge = (tabElement as any)?.badge
3335
const showBadge = badge && badge > 0
3436

@@ -41,7 +43,13 @@ export class DevtoolsTabs extends Element {
4143
: ''} flex items-center gap-2"
4244
>
4345
<span>${tabId}</span>
44-
${showBadge ? html`<span class="inline-flex items-center justify-center min-w-[20px] px-1.5 py-0.5 text-xs font-semibold rounded-full" style="background-color: #5a5a5a; color: #ffffff;">${badge}</span>` : nothing}
46+
${showBadge
47+
? html`<span
48+
class="inline-flex items-center justify-center min-w-[20px] px-1.5 py-0.5 text-xs font-semibold rounded-full"
49+
style="background-color: #5a5a5a; color: #ffffff;"
50+
>${badge}</span
51+
>`
52+
: nothing}
4553
</button>
4654
`
4755
}

packages/app/src/components/workbench.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,13 @@ export class DevtoolsWorkbench extends Element {
192192
<wdio-devtools-tab label="Log">
193193
<wdio-devtools-logs></wdio-devtools-logs>
194194
</wdio-devtools-tab>
195-
<wdio-devtools-tab label="Console" .badge="${this.consoleLogs?.length || 0}">
196-
<wdio-devtools-console-logs id="console-logs-tab"></wdio-devtools-console-logs>
195+
<wdio-devtools-tab
196+
label="Console"
197+
.badge="${this.consoleLogs?.length || 0}"
198+
>
199+
<wdio-devtools-console-logs
200+
id="console-logs-tab"
201+
></wdio-devtools-console-logs>
197202
</wdio-devtools-tab>
198203
<wdio-devtools-tab label="Network">
199204
<section

packages/app/src/components/workbench/console.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export class DevtoolsConsoleLogs extends Element {
3030
.console-container {
3131
flex: 1;
3232
overflow-y: auto;
33-
font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
33+
font-family:
34+
'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas,
35+
'Courier New', monospace;
3436
font-size: 13px;
3537
line-height: 1.6;
3638
}
@@ -157,14 +159,18 @@ export class DevtoolsConsoleLogs extends Element {
157159

158160
#formatArgs(args: any[]): string {
159161
if (Array.isArray(args)) {
160-
return args.map(arg => {
161-
if (typeof arg === 'string') return arg
162-
try {
163-
return JSON.stringify(arg, null, 2)
164-
} catch {
165-
return String(arg)
166-
}
167-
}).join(' ')
162+
return args
163+
.map((arg) => {
164+
if (typeof arg === 'string') {
165+
return arg
166+
}
167+
try {
168+
return JSON.stringify(arg, null, 2)
169+
} catch {
170+
return String(arg)
171+
}
172+
})
173+
.join(' ')
168174
}
169175
return String(args)
170176
}
@@ -195,11 +201,15 @@ export class DevtoolsConsoleLogs extends Element {
195201
return html`
196202
<div class="log-entry log-type-${log.type || 'log'}">
197203
${log.timestamp
198-
? html`<div class="log-time">${this.#formatElapsedTime(log.timestamp)}</div>`
204+
? html`<div class="log-time">
205+
${this.#formatElapsedTime(log.timestamp)}
206+
</div>`
199207
: nothing}
200208
<div class="log-icon">${icon}</div>
201209
<div class="log-content">
202-
${log.source === 'test' ? html`<span class="log-prefix">>>></span>` : nothing}
210+
${log.source === 'test'
211+
? html`<span class="log-prefix">>>></span>`
212+
: nothing}
203213
<span class="log-message">${this.#formatArgs(log.args)}</span>
204214
</div>
205215
</div>

packages/service/src/session.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ export class SessionCapturer {
6565
const logEntry: ConsoleLogs = {
6666
timestamp: Date.now(),
6767
type: method,
68-
args: args.map(arg =>
68+
args: args.map((arg) =>
6969
typeof arg === 'object' && arg !== null
70-
? ((() => { try { return JSON.stringify(arg) } catch { return String(arg) } })())
70+
? (() => {
71+
try {
72+
return JSON.stringify(arg)
73+
} catch {
74+
return String(arg)
75+
}
76+
})()
7177
: String(arg)
7278
),
7379
source: 'test'
@@ -228,7 +234,7 @@ export class SessionCapturer {
228234
}
229235
if (Array.isArray(consoleLogs)) {
230236
const browserLogs = consoleLogs as ConsoleLogs[]
231-
browserLogs.forEach(log => log.source = 'browser')
237+
browserLogs.forEach((log) => (log.source = 'browser'))
232238
this.consoleLogs.push(...browserLogs)
233239
this.sendUpstream('consoleLogs', browserLogs)
234240
}

0 commit comments

Comments
 (0)