UNPKG

rsxjs

Version:

Resilience Extensions for JS.

17 lines (13 loc) 381 B
/** * @file tests/timeout/test-after.js * @copyright 2018-present Karim Alibhai. All rights reserved. */ import { test } from "../../helpers"; import { Timeout } from "../../../"; test("Timeout.after()", async (t) => { const timeout = 500; const start = Date.now(); const chan = Timeout.after(timeout); await chan.take(); t.true(Date.now() - start >= timeout); });