akameco / enzyme-snapshot-diff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enzyme-snapshot-diff

Build Status tested with jest styled with prettier All Contributors

snapshot-diff for enzyme

Install

$ npm install enzyme-snapshot-diff

Usage

import { mount } from 'enzyme'
import enzymeDiffSnapshot from 'enzyme-snapshot-diff'

test('snapshot', () => {
  const a = mount(<div>hello</div>)
  const b = mount(<div>world</div>)
  expect(enzymeDiffSnapshot(a, b)).toMatchInlineSnapshot(`
"Snapshot Diff:
- First value
+ Second value

  <div>
-   hello
+   world
  </div>"
`)
})

Contributors

Thanks goes to these wonderful people (emoji key):

akameco
akameco

💻 📖 ⚠️ 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco

About

License:MIT License


Languages

Language:TypeScript 87.8%Language:JavaScript 12.2%