enzymejs/enzyme

Create Adapter for React Native & React 16

Open

#1436 opened on Dec 15, 2017

View on GitHub
 (44 comments) (84 reactions) (0 assignees)JavaScript (19,979 stars) (2,016 forks)batch import
feature requesthelp wanted

Description

Problem Statement

Currently we have no support for using a react native adapter with Enzyme. This is because the current adapters are built for react native web.

Attempting to use mount with the current adapter will cause various issues from polluting the user's console with a ton of logs to inability to import necessary libraries.

While this is the case you can get some testing done by filtering the logs and using jsdom.

Most of the console error issues seem to be coming from the ReactDOM call for the React 16 adapter here

Purpose

The purpose of this ticket is to track work related to implementation and decisions regarding implementation of a react native enzyme adapter.

TODO

  1. Find an alternative to rendering with ReactDOM
  2. Decide best way to use the solution for (1) with existing adapters
  3. Decide whether we would like to do all necessary react native stubbing in the adapter a-la react-native-mock-render, do a RYO implementation, or not take a firm stance to the native mocking
  4. Add unit tests to verify functionality
  5. Update Necessary Docs

Related Issues

https://github.com/airbnb/enzyme/issues/1390 https://github.com/airbnb/enzyme/issues/831

Contributor guide