0.1.0 • Published 6 years ago

mithril-serializer v0.1.0

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

mithril-serializer

Build Status

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.