Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda