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

Function createAssertInlineSnapshot

testing/unstable_snapshot.ts:302–320  ·  view source on GitHub ↗
(
  options: InlineSnapshotOptions<T>,
  baseAssertSnapshot: typeof assertInlineSnapshot = assertInlineSnapshot,
)

Source from the content-addressed store, hash-verified

300 * @returns {@linkcode assertInlineSnapshot} function with the given default options.
301 */
302export function createAssertInlineSnapshot<T>(
303 options: InlineSnapshotOptions<T>,
304 baseAssertSnapshot: typeof assertInlineSnapshot = assertInlineSnapshot,
305): typeof assertInlineSnapshot {
306 return function (
307 actual: T,
308 expectedSnapshot: string,
309 messageOrOptions?: string | InlineSnapshotOptions<T>,
310 ) {
311 const mergedOptions: InlineSnapshotOptions<T> = {
312 ...options,
313 ...(typeof messageOrOptions === "string"
314 ? { msg: messageOrOptions }
315 : messageOrOptions),
316 };
317
318 baseAssertSnapshot(actual, expectedSnapshot, mergedOptions);
319 };
320}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected