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

x/capi/deps/std/testing/snapshot.ts>assertSnapshot

[WIP] A framework for crafting interactions with Substrate chains
Latest
function assertSnapshot
import { assertSnapshot } from "https://deno.land/x/capi@v0.1.1-beta.1/deps/std/testing/snapshot.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.

Examples

Example 1

import { assertSnapshot } from "https://deno.land/std@0.224.0/testing/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>