then i tried code coverage and found that the return statement in the Intro.js file was uncovered. here's the link to the code and jest official docs: https://jestjs.io/docs/tutorial-react-native [1]: https://i.stack.imgur.com/CcIDX.png [2]: https://i.stack.imgur.com/VhhIL.png
Intro.js
`import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
class Intro extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>
This is a React Native snapshot test.
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
alignItems: 'center',
backgroundColor: '#F5FCFF',
flex: 1,
justifyContent: 'center',
},
instructions: {
color: '#333333',
marginBottom: 5,
textAlign: 'center',
},
welcome: {
fontSize: 20,
margin: 10,
textAlign: 'center',
},
});
export default Intro;`
Intro-test.js
`import React from 'react';
import renderer from 'react-test-renderer';
import Intro from '../Components/CarsList/Intro'
test('renders correctly', () => {
const tree = renderer.create(<Intro />).toJSON();
expect(tree).toMatchSnapshot();
});`