Skip to content

Commit

Permalink
fix: remove withTimeout()
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc committed Feb 6, 2025
1 parent f5a677d commit f223d79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
5 changes: 0 additions & 5 deletions src/shared/errors/timeout.error.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/utils/with-timeout.ts

This file was deleted.

20 changes: 10 additions & 10 deletions tests/fixtures/simulate-game-server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { test, expect as baseExpect } from '@playwright/test'
import { GameServerSimulator } from '../game-server-simulator'
import { withTimeout } from '../../src/utils/with-timeout'
import { secondsToMilliseconds } from 'date-fns'
import { TimeoutError } from '../../src/shared/errors/timeout.error'
import { TimeoutError, withTimeout } from 'es-toolkit'

export const simulateGameServer = test.extend<{ gameServer: GameServerSimulator }>({
// eslint-disable-next-line no-empty-pattern
Expand Down Expand Up @@ -40,17 +39,18 @@ export const expect = baseExpect.extend({

try {
await withTimeout(
new Promise<void>(resolve => {
if (hasCommand()) {
resolve()
}

setInterval(() => {
() =>
new Promise<void>(resolve => {
if (hasCommand()) {
resolve()
}
}, secondsToMilliseconds(0.5))
}),

setInterval(() => {
if (hasCommand()) {
resolve()
}
}, secondsToMilliseconds(0.5))
}),
options?.timeout ?? this.timeout,
)
pass = true
Expand Down

0 comments on commit f223d79

Please sign in to comment.