Code Monkey home page Code Monkey logo

ganeshpadhayay / exploring-react-native Goto Github PK

View Code? Open in Web Editor NEW
31.0 2.0 8.0 4.08 MB

This uses testing libraries(jest, react-native-testing-library, detox) in clean architecture context in react native, redux setup, thunk, axios, and code-push

JavaScript 59.52% Starlark 1.58% Java 20.33% Ruby 2.30% Objective-C 11.78% TypeScript 4.49%
react-native-app react-native-testing jest-tests hermes-engine clean-architecture react-native-testing-library detox redux formik axios

exploring-react-native's Introduction

In this repo, I have used:

  1. jest - this comes in built with a vanilla react native project and used for unit testing functions and objects. It can also be used to do snapshot testing for compoments but I do not prefer that as it becomes difficult to manage complex components.
  2. react-native-testing-library - this is being used to test the components behaviour, this is different from enzyme as it only tests the behaviour and not the internals of a component(who wants to test the internals anyway?).
  3. detox - this is being used to write robust end to end tests in conjunction with Jest runner.

This whole sample focuses on implementing the Uncle Bob's clean architecture in react native and writing tests in accordance with that architecture.

Feel free to point out mistakes as I am a complete newbie when it comes to react-native.

Here is the package.json file for this project dated 28th July 2020

{ "name": "sample-clean-testing-architecture", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "axios": "^0.19.2", "react": "16.13.1", "react-native": "0.63.1", "react-native-testing-library": "^2.1.1" }, "devDependencies": { "@babel/core": "^7.8.4", "@babel/runtime": "^7.8.4", "@react-native-community/eslint-config": "^1.1.0", "@types/jest": "^26.0.7", "@types/react": "^16.9.43", "@types/react-native": "^0.63.2", "@types/react-test-renderer": "^16.9.2", "babel-jest": "^25.1.0", "detox": "^17.2.1", "eslint": "^6.5.1", "jest": "^26.0.1", "jest-circus": "^26.1.0", "metro-react-native-babel-preset": "^0.59.0", "react-test-renderer": "^16.13.1", "typescript": "^3.9.7" }, "jest": { "preset": "react-native" } }

Thanks!

exploring-react-native's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.