Please provide the following:
- SDK Version: 43
- Platforms(Android/iOS/web/all): all
I’m following the directions in the Testing with Jest expo docs to create a test that just renders the root of my app.
import React from 'react';
import renderer from 'react-test-renderer';
import App from './App';
describe('<App />', () => {
it('has 1 child', () => {
const tree = renderer.create(<App />).toJSON();
expect(tree.children.length).toBe(1);
});
});
But I get an error because tree.children
is null. This is weird, because the app works just fine.
When I created a snapshot, it looks like this:
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<App /> has 1 child 1`] = `
<RNCSafeAreaProvider
onInsetsChange={[Function]}
style={
Array [
Object {
"flex": 1,
},
undefined,
]
}
/>
`;
Any idea what I’m doing wrong?