diff --git a/memory-viz/src/plugins/pretty_svg.ts b/memory-viz/src/plugins/pretty_svg.ts index 5fc9e02..2cb5c8a 100644 --- a/memory-viz/src/plugins/pretty_svg.ts +++ b/memory-viz/src/plugins/pretty_svg.ts @@ -1,8 +1,11 @@ -import type { NewPlugin, OldPlugin } from "pretty-format"; +// Custom pretty-format plugin for serializing SVG elements +// See https://github.com/jestjs/jest/tree/main/packages/pretty-format#writing-plugins for more information + +import type { NewPlugin } from "pretty-format"; import pretty from "pretty"; -import { parse } from "node-html-parser"; +import { parse, HTMLElement } from "node-html-parser"; -export const serialize: NewPlugin["serialize"] = (val) => { +export const serialize: NewPlugin["serialize"] = (val: HTMLElement) => { return pretty(val); };