MCPcopy Create free account
hub / github.com/denoland/std / createAssertSnapshot

Function createAssertSnapshot

testing/snapshot.ts:695–715  ·  view source on GitHub ↗
(
  options: SnapshotOptions<T>,
  baseAssertSnapshot: typeof assertSnapshot = assertSnapshot,
)

Source from the content-addressed store, hash-verified

693 * (Deno 2.9+) instead.
694 */
695export function createAssertSnapshot<T>(
696 options: SnapshotOptions<T>,
697 baseAssertSnapshot: typeof assertSnapshot = assertSnapshot,
698): typeof assertSnapshot {
699 return async function (
700 context: Deno.TestContext,
701 actual: T,
702 messageOrOptions?: string | SnapshotOptions<T>,
703 ) {
704 const mergedOptions: SnapshotOptions<T> = {
705 ...options,
706 ...(typeof messageOrOptions === "string"
707 ? {
708 msg: messageOrOptions,
709 }
710 : messageOrOptions),
711 };
712
713 await baseAssertSnapshot(context, actual, mergedOptions);
714 };
715}

Callers 1

snapshot_test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected