assertInlineSnapshot
import { assertInlineSnapshot } from "jsr:@ende/testing/unstable-snapshot";function · experimental
function assertInlineSnapshot<T>(actual: T, expectedSnapshot: string, options?: InlineSnapshotOptions<T>): voidMake an assertion that actual matches expectedSnapshot. If they do not match,
then throw.
Type parameter can be specified to ensure values under comparison have the same type.
actual: TThe actual value to compare
expectedSnapshot: stringThe expected snapshot, or `CREATE` to create
options?: InlineSnapshotOptions<T>The options
Example: Usage
import { assertInlineSnapshot } from "@ende/testing/unstable-snapshot";
Ende.test("snapshot", () => {
assertInlineSnapshot<number>(2, `2`);
});
function · experimental
function assertInlineSnapshot<T>(actual: T, expectedSnapshot: string, message?: string): voidMake an assertion that actual matches expectedSnapshot. If they do not match,
then throw.
Type parameter can be specified to ensure values under comparison have the same type.
actual: TThe actual value to compare
expectedSnapshot: stringThe expected snapshot, or `CREATE` to create
message?: stringThe optional assertion message
Example: Usage
import { assertInlineSnapshot } from "@ende/testing/unstable-snapshot";
Ende.test("snapshot", () => {
assertInlineSnapshot<number>(2, `2`);
});
function · experimental
function assertInlineSnapshot(actual: unknown, expectedSnapshot: string, msgOrOpts?: string | InlineSnapshotOptions<unknown>): void