unexpected-react icon indicating copy to clipboard operation
unexpected-react copied to clipboard

Plugin for http://unexpected.js.org to enable testing the full React virtual DOM, and also the shallow renderer

Results 23 unexpected-react issues
Sort by recently updated
recently updated
newest added

When I use the `with event` assertion for `ReactTestRenderer`, I get this warning. So this pull request will fix that.

Getting these warnings after upgrading react-* to the latest: ``` npm WARN [email protected] requires a peer of react@^16.9.0 but none is installed. You must install peer dependencies yourself. npm WARN...

Expected this test to pass: ```jsx test('html white space', () => { expect( {'foo bar'}, 'to deeply render as', foo bar ); }); ``` Got this failure instead: ``` UnexpectedError:...

This test ```jsx test('renders row', () => { const Row = () => ( Hello ); expect( , 'to deeply render as', Hello ); }); ``` Prints this warning: ```...

I *expected* this to pass: ```jsx it('calls events with currentTarget', () => { const EventTargetComponent = () => { const [value, setValue] = useState(); const handleChange = (event) => setValue(event.currentTarget.value);...

I was trying to use the shallow renderer to invoke a custom event handler with a string argument, eg. `aliensLanded('thousand')`. Tried this: ```jsx it('calls events with string event parameter', ()...

Without this a fresh install using Jest fails: ``` ● Test suite failed to run Cannot find module 'mkdirp' from 'node_modules/unexpected-react/lib/helpers/snapshots.js' Require stack: node_modules/unexpected-react/lib/helpers/snapshots.js node_modules/unexpected-react/lib/assertions/jestSnapshotTestRendererAssertions.js node_modules/unexpected-react/lib/test-renderer-jest.js node_modules/unexpected-react/test-renderer-jest.js src/__tests__/ClickCounter.spec.js ```

Something like this: ```jsx it('finds nested text', () => { const component = TestUtils.renderIntoDocument(42); return expect(component, 'to contain', '42' ); }); ``` Even nicer nicer would be supporting regexes in...

When using the `to contain` assertion, sometimes the failure message tries to be helpful and shows a best match. Now this best match can be an absolute false positive, not...

This test currently fails: ```tsx it('renders a component with a fragment at the root', function () { const Fragment = function () { return YayYeah; }; expect(, 'to deeply render...