mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
e7c6d36abf
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
24 lines
532 B
TypeScript
24 lines
532 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { expect } from "./expect.ts";
|
|
import { addSerializer, getSerializer } from "./_serializer.ts";
|
|
import type { SnapshotPlugin } from "./_types.ts";
|
|
|
|
const foo: SnapshotPlugin = {
|
|
serialize() {
|
|
return "foot";
|
|
},
|
|
test() {
|
|
return false;
|
|
},
|
|
};
|
|
|
|
Deno.test("initial serializer", () => {
|
|
expect(getSerializer()).toHaveLength(0);
|
|
});
|
|
|
|
Deno.test("add serializer", () => {
|
|
addSerializer(foo);
|
|
expect(getSerializer()).toHaveLength(1);
|
|
});
|