Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/expect/expect.ts>Expected

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
interface Expected
import { type Expected } from "https://deno.land/std@0.209.0/expect/expect.ts";

Methods

lastCalledWith(...expected: unknown[]): void
lastReturnedWith(expected: unknown): void
nthCalledWith(nth: number, ...expected: unknown[]): void
nthReturnedWith(nth: number, expected: unknown): void
toBeCalled(): void
toBeCalledTimes(expected: number): void
toBeCalledWith(...expected: unknown[]): void
toBeCloseTo(candidate: number, tolerance?: number): void
toBeDefined(): void
toBeFalsy(): void
toBeGreaterThan(expected: number): void
toBeGreaterThanOrEqual(expected: number): void
toBeInstanceOf<T extends AnyConstructor>(expected: T): void
toBeLessThan(expected: number): void
toBeLessThanOrEqual(expected: number): void
toBeNaN(): void
toBeNull(): void
toBeTruthy(): void
toBeUndefined(): void
toBe(expected: unknown): void
toContainEqual(expected: unknown): void
toContain(expected: unknown): void
toEqual(expected: unknown): void
toHaveBeenCalledTimes(expected: number): void
toHaveBeenCalledWith(...expected: unknown[]): void
toHaveBeenCalled(): void
toHaveBeenLastCalledWith(...expected: unknown[]): void
toHaveBeenNthCalledWith(nth: number, ...expected: unknown[]): void
toHaveLength(expected: number): void
toHaveLastReturnedWith(expected: unknown): void
toHaveNthReturnedWith(nth: number, expected: unknown): void
toHaveProperty(propName: string | string[], value?: unknown): void
toHaveReturnedTimes(expected: number): void
toHaveReturnedWith(expected: unknown): void
toHaveReturned(): void
toMatch(expected: RegExp): void
toMatchObject(expected: Record<PropertyKey, unknown>): void
toReturn(): void
toReturnTimes(expected: number): void
toReturnWith(expected: unknown): void
toStrictEqual(candidate: unknown): void
toThrow<E extends Error = Error>(expected?:
| string
| RegExp
| E
| (new (...args: any[]) => E)
): void