Skip to content

Instantly share code, notes, and snippets.

@pho3nixf1re
Last active May 11, 2017 16:20
Show Gist options
  • Save pho3nixf1re/4c23d77709ce4ef044ebae7c937940ec to your computer and use it in GitHub Desktop.
Save pho3nixf1re/4c23d77709ce4ef044ebae7c937940ec to your computer and use it in GitHub Desktop.
1) Run the test `ava ava-snapshot-split-error.js`. 2) Change 'change me' to something else. 3) Re-run the test to throw the error `TypeError: Cannot read property 'split' of null`.
import React from 'react';
import test from 'ava';
import { render } from 'enzyme';
const TestMe = ({ me }) => (
<div>
<p>{me}</p>
</div>
);
test('renders the component', t => {
const wrapper = render(<TestMe me='change me' />);
t.snapshot(wrapper.html());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment