Skip to content

Commit

Permalink
test: fix TimeoutError condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jun 13, 2024
1 parent 06c25c6 commit a5d1633
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import kill from 'tree-kill'
import fs from 'fs/promises'
import { spawn } from 'cross-spawn'
import type { Page } from '@playwright/test'
import { test, expect } from '@playwright/test'
import { test, expect, errors } from '@playwright/test'

export const isDebug = process.env.DEBUG === '1'

Expand Down Expand Up @@ -190,8 +190,7 @@ export const waitForHMRPolling = async (page: Page, timeout = 30000) => {
timeout
})
} catch (e) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((e as any).name === 'TimeoutError') {
if (e instanceof errors.TimeoutError) {
console.warn('waitForHMRPolling timeout:', browserLogs)
} else {
throw e
Expand Down

0 comments on commit a5d1633

Please sign in to comment.