createAssertInlineSnapshot
import { createAssertInlineSnapshot } from "jsr:@ende/testing/unstable-snapshot";function ยท experimental
function createAssertInlineSnapshot<T>(options: InlineSnapshotOptions<T>, baseAssertSnapshot: typeof assertInlineSnapshot = assertInlineSnapshot): typeof assertInlineSnapshotCreate assertInlineSnapshot function with the given options.
The specified option becomes the default for returned assertInlineSnapshot
options: InlineSnapshotOptions<T>The options
baseAssertSnapshot: typeof assertInlineSnapshot = assertInlineSnapshotassertInlineSnapshotfunction implementation. Default to the originalassertInlineSnapshot
Returns
function with the given default options.
Example: Usage
import { createAssertInlineSnapshot } from "@ende/testing/unstable-snapshot";
const assertInlineSnapshot = createAssertInlineSnapshot({
serializer: JSON.stringify,
});
Ende.test("a snapshot test case", () => {
assertInlineSnapshot(
{ foo: "Hello", bar: undefined },
`{"foo":"Hello"}`
);
})