mithril-serializer

0.1.0 • Public • Published

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.

Package Sidebar

Install

npm i mithril-serializer

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

5.35 kB

Total Files

8

Last publish

Collaborators

  • diogodoreto