All Projects → varmais → react-native-unit-tests

varmais / react-native-unit-tests

Licence: other
Example how to test React Native components

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to react-native-unit-tests

Mocha
☕️ simple, flexible, fun javascript test framework for node.js & the browser
Stars: ✭ 20,986 (+26464.56%)
Mutual labels:  mocha, testing-tools
Suman
🌇 🌆 🌉 Advanced, user-friendly, language-agnostic, super-high-performance test runner. http://sumanjs.org
Stars: ✭ 57 (-27.85%)
Mutual labels:  mocha, testing-tools
Jobsort
job board that queries hacker news who is hiring job listings from a database and sorts by tech the user knows and how well the user knows them
Stars: ✭ 20 (-74.68%)
Mutual labels:  mocha, enzyme
mocha-snapshots
Snapshot/regression testing for using with Mocha, specially for React+Enzyme users.
Stars: ✭ 53 (-32.91%)
Mutual labels:  mocha, enzyme
Serverless Mocha Plugin
Plugin for Serverless Framework which adds support for test-driven development using Mocha
Stars: ✭ 152 (+92.41%)
Mutual labels:  mocha, test-driven-development
React Hot Redux Firebase Starter
🌋 React + Redux + Firebase + Webpack + React Hot Loader 3 + React Router in one boilerplate
Stars: ✭ 375 (+374.68%)
Mutual labels:  mocha, enzyme
Bombanauts
Bombanauts, inspired by the original Bomberman game, is a 3D multiplayer online battle arena (MOBA) game where players can throw bombs at each other, make boxes explode, and even other players!
Stars: ✭ 54 (-31.65%)
Mutual labels:  mocha, test-driven-development
Telegraf-Test
Telegraf Test - Simple Test ToolKit of Telegram Bots
Stars: ✭ 22 (-72.15%)
Mutual labels:  mocha, testing-tools
Ts Mocha
Mocha thin wrapper that allows running TypeScript tests with TypeScript runtime (ts-node) to get rid of compilation complexity
Stars: ✭ 119 (+50.63%)
Mutual labels:  mocha, testing-tools
Serverless Jest Plugin
Plugin for Serverless Framework which adds support for test-driven development using Jest
Stars: ✭ 111 (+40.51%)
Mutual labels:  mocha, test-driven-development
jest-wrap
Fluent pluggable interface for easily wrapping `describe` and `it` blocks in Jest tests.
Stars: ✭ 35 (-55.7%)
Mutual labels:  mocha, testing-tools
Testdeck
Object oriented testing
Stars: ✭ 206 (+160.76%)
Mutual labels:  mocha, testing-tools
react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (-75.95%)
Mutual labels:  mocha, enzyme
Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+24939.24%)
Mutual labels:  mocha, enzyme
cucumber-steps
🥒 Quick start for testing with Cucumber.js
Stars: ✭ 15 (-81.01%)
Mutual labels:  mocha, testing-tools
Should Enzyme
Useful functions for testing React Components with Enzyme.
Stars: ✭ 41 (-48.1%)
Mutual labels:  mocha, enzyme
playwright-test
Run unit tests with several runners or benchmark inside real browsers with playwright.
Stars: ✭ 81 (+2.53%)
Mutual labels:  mocha, testing-tools
react-testing-mocha-chai-enzyme
A solid test setup for React components with Mocha, Chai, Sinon, Enzyme in a Webpack/Babel application.
Stars: ✭ 48 (-39.24%)
Mutual labels:  mocha, enzyme
React Base
atSistemas React/Redux Isomorphic Platform
Stars: ✭ 82 (+3.8%)
Mutual labels:  mocha, enzyme
React Redux Universal Boilerplate
An Universal ReactJS/Redux Boilerplate
Stars: ✭ 165 (+108.86%)
Mutual labels:  mocha, enzyme

React Native Testing Example App

Example application to show how to unit test React Native components and rewire modules using ES6 import syntax.

Application tested only on iOS but should run on Android as well. Main purpose of this application is to show how to setup unit testing for React Native components using AirBnB's enzyme library.

Application also utilizes babel-plugin-rewire as an example how to rewire modules which are imported using ES6 syntax instead of CommonJS syntax.

I've written about unit testing React Native components in more depth in Valuemotive blog: Unit Testing React Native Components with Mocha and Enzyme.

EDIT: Added Jest tests.

Installation and usage

$ npm install

All mocha tests:
$ npm run mocha

Single component on mocha watch mode:
$ npm run mocha:watch ReactNativeTestingUtils

All jest tests:
$ npm run jest

Jest watch mode:
$ npm run jest -- --watch

Modules used for testing:

License

MIT License

Copyright (c) 2017 VarmaIS

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].