enzymejs/enzyme

Create Adapter for React Native & React 16

Open

#1,436 创建于 2017年12月15日

在 GitHub 查看
 (44 评论) (84 反应) (0 负责人)JavaScript (19,979 star) (2,016 fork)batch import
feature requesthelp wanted

描述

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

贡献者指南