You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* @jest-environment jsdom
*/
import React from 'react';
import { ScrollView } from 'react-native';
import { mount } from 'enzyme';
describe('Card', () => {
let wrapper;
describe('copy', () => {
it('should render text', () => {
const tree = mount(
<ScrollView>
</ScrollView>
);
expect(tree).toMatchSnapshot();
});
)};
)};
Current behavior
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: symbol.
> 52 | const tree = mount(
| ^
53 | <ScrollView>
54 | </ScrollView>
55 | );
Expected behavior
Should be able to mount react native component
Your environment
API
shallow
mount
render
Version
library
version
enzyme
3.9.0
react
16.4.1
react-dom
16.0.0
react-test-renderer
16.0.0
adapter (below)
1.10.0
react-native: 0.56.0
jest: 23.2.0
Adapter
enzyme-adapter-react-16
enzyme-adapter-react-16.3
enzyme-adapter-react-16.2
enzyme-adapter-react-16.1
enzyme-adapter-react-15
enzyme-adapter-react-15.4
enzyme-adapter-react-14
enzyme-adapter-react-13
enzyme-adapter-react-helper
others ( )
The text was updated successfully, but these errors were encountered:
Using jest with enzyme and react native
I've followed the instructions in (did not add jsdom stuff in setup-tests.js as I'm using jest)
https://github.com/airbnb/enzyme/blob/master/docs/guides/react-native.md
And mount should work, according to the documentation. Please advise.
The stripped down test file as below.
Current behavior
Expected behavior
Should be able to mount react native component
Your environment
API
Version
react-native: 0.56.0
jest: 23.2.0
Adapter
The text was updated successfully, but these errors were encountered: