-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desired
Description
Description
When snapshots do not match a type error is thrown instead of the diff. TypeError: Cannot read property 'split' of null
.
Test Source
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());
});
Error Message & Stack Trace
Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning.
✖ renders the component Error thrown in test
1 test failed [11:04:02]
renders the component
/path/to/example.test.js:13
12: const wrapper = render(<TestMe me='change us' />);
13: t.snapshot(wrapper.html());
14: });
Error thrown in test
Error:
[TypeError: Cannot read property 'split' of null]
Config
Copy the relevant section from package.json
:
{
"ava": {
"require": [
"babel-register",
"./test-environment.js"
],
"babel": "inherit",
"files": [
"**/*.test.js",
"!node_modules"
]
}
}
Command-Line Arguments
Copy your npm build scripts or the ava
command used:
ava --verbose path/to/example.test.js
Relevant Links
https://gist.github.com/pho3nixf1re/4c23d77709ce4ef044ebae7c937940ec
Environment
Node.js v7.10.0
darwin 16.5.0
AVA 0.19.1
npm 4.2.0
yarn v0.23.4
davidjbradshaw and scott-cornwell
Metadata
Metadata
Assignees
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desired