Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license

This commit is contained in:
2026-09-05 13:26:46 +03:00
commit 03634b1ca3
11340 changed files with 3442369 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it, vi } from 'vitest'
import { withTimeout } from './with-timeout'
describe('withTimeout', () => {
it('rejects with an onTimeout exception instead of letting it escape the timer callback', async () => {
vi.useFakeTimers()
try {
const callbackFailure = new Error('abort callback failed')
const result = withTimeout(new Promise<never>(() => undefined), 10, 'work timed out', () => {
throw callbackFailure
})
const rejection = expect(result).rejects.toBe(callbackFailure)
await vi.advanceTimersByTimeAsync(10)
await rejection
} finally {
vi.useRealTimers()
}
})
})