TimeError

import { TimeError } from "jsr:@ende/testing/time";

class

class TimeError extends Error

Represents an error when trying to execute an invalid operation on fake time, given the state fake time is in.

Example: Usage

import { FakeTime, TimeError } from "@ende/testing/time";
import { assertThrows } from "@ende/assert";

assertThrows(() => {
  const time = new FakeTime();
  time.restore();
  time.restore();
}, TimeError);

Constructors

constructor

new TimeError(message: string)

Construct TimeError.

message: string

The error message

Source