Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Tools for testing Deno code like snapshot testing, bdd testing, and time mocking
Testing utilities for types.
import { assertType, IsExact, IsNullable } from "@std/testing/types"; const result = "some result" as string | number; // compile error if the type of `result` is not exactly `string | number` assertType<IsExact<typeof result, string | number>>(true); // causes a compile error that `true` is not assignable to `false` assertType<IsNullable<string>>(true); // error: string is not nullable
Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type.
Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type.
Asserts at compile time that the provided type argument's type resolves to false.
Asserts at compile time that the provided type argument's type resolves to true.
Checks if type T has the specified type U.
Checks if type T is the any type.
Checks if type T exactly matches type U.
Checks if type T is the never type.
Checks if type T is possibly null or undefined.
Checks if type T is the unknown type.
Checks if type T does not have the specified type U.
Add Package
deno add jsr:@std/testing
Import symbol
import * as mod from "@std/testing/types";
Import directly with a jsr specifier
import * as mod from "jsr:@std/testing/types";