Module

x/fresh/src/server/deps.ts>assertSnapshot

The next-gen web framework.
Extremely Popular
Latest
function assertSnapshot
import { assertSnapshot } from "https://dotland.deno.dev/x/fresh@1.7.3/src/server/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.

Examples

Example 1

import { assertSnapshot } from "https://deno.land/std@$STD_VERSION/testing/snapshot.ts";

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

Parameters

context: Deno.TestContext
actual: T
options: SnapshotOptions<T>

Returns

Promise<void>

Parameters

context: Deno.TestContext
actual: T
optional
message: string

Returns

Promise<void>