luego probé la cobertura de código y descubrí que se descubrió la declaración de devolución en el archivo Intro.js. aquí está el enlace al código y a los documentos oficiales de broma: 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(); });`