Skip to main content
Module

x/cliffy/dev_deps.ts>assertSnapshot

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
function assertSnapshot
import { assertSnapshot } from "https://deno.land/x/cliffy@v0.25.1/dev_deps.ts";

Make an assertion that actual matches a snapshot. If the snapshot and actual do not a match, then throw.

Type parameter can be specified to ensure values under comparison have the same type. For example:

import { assertSnapshot } from "./snapshot.ts";

Deno.test("snapshot", async (test) => {
 await assertSnapshot<number>(test, 2);
});

Parameters

actual: T
options: SnapshotOptions<T>

Returns

Promise<void>

Parameters

actual: T
optional
message: string

Returns

Promise<void>