mithril-serializer
v0.1.0
Published
Mithril serializer plugin for pretty-format
Downloads
5
Maintainers
Readme
mithril-serializer
Mithril serializer plugin for pretty-format
Examples
test('node with content', () => {
const vnode = m('div', 'Hello');
expect(vnode).toMatchInlineSnapshot(`
<div>
Hello
</div>
`);
});
Check our own test cases for more examples.
How to use
Add this plugin to your devDependencies with:
npm install --save-dev mithril-serializer
Add the following config to your jest.config.js
file:
snapshotSerializers: ['mithril-serializer']
Now Jest is able to pretty print Mithril's vnodes in your snapshots.