Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
i was trying to test the code given in the Jest docs for testing but still got error

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();
 });`
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!