Skip to content

Instantly share code, notes, and snippets.

@LeeCheneler
Last active February 6, 2020 17:24
Show Gist options
  • Select an option

  • Save LeeCheneler/15d9c441a3be4c57ac862ba125600519 to your computer and use it in GitHub Desktop.

Select an option

Save LeeCheneler/15d9c441a3be4c57ac862ba125600519 to your computer and use it in GitHub Desktop.
import fs from "fs";
import path from "path";
import { prettyDOM } from "@testing-library/react";
const writeDomToFile = (filename = "test-dom.html") => {
const dom = prettyDOM(document.body, 9999999, { highlight: false });
fs.writeFileSync(path.resolve(__dirname, filename), dom);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment