serialize

import { serialize } from "jsr:@ende/testing/snapshot";

function ยท deprecated

function serialize(actual: unknown): string

Default serializer for assertSnapshot.

actual: unknown

The value to serialize

Deprecated.

This will be removed in 2.0.0. The built-in t.assertSnapshot() (Ende 2.9+) uses the same serialization by default; for custom serialization, call Ende.inspect() directly.

Returns

The serialized string

Example: Usage

import { serialize } from "@ende/testing/snapshot";
import { assertEquals } from "@ende/assert";

assertEquals(serialize({ foo: 42 }), "{\n  foo: 42,\n}")

Source