0.0.1 • Published 12 months ago

@react-templates/jest-serializer v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@react-templates/jest-serializer

Serializes React elements into an HTML snapshot.

Usage

// package.json
{
  "jest": {
    "snapshotSerializers": ["@react-templates/jest-serializer"]
  }
}
import React from 'react';

test('serializes to html', async () => {
  expect(
    <html>
      <head>
        <title>Snapshot</title>
      </head>
      <body>
        <p>Hello, John!</p>
      </body>
    </html>
  ).toMatchSnapshot();
});
exports[`serializes to html`] = `
  <html>
    <head>
      <title>Snapshot</title>
    </head>
    <body>
      <p>Hello, John!</p>
    </body>
  </html>
`;
0.0.1

12 months ago