Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

304
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda