-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
608 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { NewPlugin, OldPlugin } from "pretty-format"; | ||
import pretty from "pretty"; | ||
import { parse } from "node-html-parser"; | ||
|
||
export const serialize: NewPlugin["serialize"] = (val) => { | ||
return pretty(val); | ||
}; | ||
|
||
export const test: NewPlugin["test"] = (val: any) => { | ||
const root = parse(val); | ||
return root.firstChild.rawTagName === "svg"; | ||
}; | ||
|
||
export const plugin: NewPlugin = { | ||
test, | ||
serialize, | ||
}; | ||
|
||
export default plugin; |
Oops, something went wrong.