Creando React Native Apps con Enzyme

Photo by Zoltan Tasi on Unsplash

React Native

Enzyme


Creando el proyecto

$ npm install -g create-react-native-app
$ create-react-native-app my-test-app-enzyme
$ npm start
First Screen

Instalando Enzyme

$ npm install --save-dev enzyme enzyme-to-json enzyme-adapter-react-16 react-dom

Creando nuestro test

$ npm run test
$ npm run test -- --watch
Default test result for App.test.js
Button not found for App.test.js
Button founded in view App.js
Button displayed in view

Simulando eventos — Press

Simulando eventos — Change

Conclusión

Lean Mind

Lean Mind Blog

Thanks to Cristian Suarez and Daniel Ramos Acosta.

Adrián Ferrera González

Written by

Full Stack Developer. JavaScript ❤️ (adrian.afergon@gmail.com)

Lean Mind

Lean Mind

Lean Mind Blog