@react-templates/jest-serializer
v0.0.1
Published
Serializes React templates to HTML
Downloads
41
Readme
@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>
`;