Skip to main content
Module

x/retry/wait/timeoutError_test.ts

Re-execute a function until it does not throw an error or execute a function with a timeout.
Very Popular
Latest
File
// Copyright since 2020, FranckLdx. All rights reserved. MIT license.import { assertEquals } from "../dev_deps.ts";import { isTimeoutError, TimeoutError } from "./timeoutError.ts";
Deno.test({ name: "Should return false when error is not a TimeoutError", fn: () => { const error = new Error("BOOM"); assertEquals(isTimeoutError(error), false); },});
Deno.test({ name: "Should return true when error is a TimeoutError", fn: () => { const error = new TimeoutError(); assertEquals(isTimeoutError(error), true); },});