1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-09 18:39:58 +00:00
elk/tests/setup.ts

9 lines
318 B
TypeScript
Raw Normal View History

2024-01-09 08:56:15 +00:00
// We have TypeError: AbortSignal.timeout is not a function when running tests against masto.js v6
if (!AbortSignal.timeout) {
AbortSignal.timeout = (ms) => {
const controller = new AbortController()
setTimeout(() => controller.abort(new DOMException('TimeoutError')), ms)
return controller.signal
}
}