How to add jest specific setup to create-responsive-native application?

I created a project with create-react-native-app and I want to use jest-enzymematchers, their Readme has a section on how to use it with create-react-app, but I did not find any information on how to use it with create-react-native-app.

To add these sockets, I only need to create a jest installation file, but create-react-native-appcannot see it, to allow a custom jest installation file.

So can you use the custom jest installation file without extracting create-react-native-app from the application?

Also is there a way to add a file jestfor create-react-native-app?

+4
source share
1 answer

It is possible that you are looking for http://airbnb.io/enzyme/docs/guides/react-native.html , which explains the following:

Unfortunately, React Native has many environmental dependencies that are difficult to model without a host device.

This can be tricky if you want your test suite to work with typical continuous integration servers such as Travis.

There is a clean React Native JS layout and can solve this problem in most use cases.

To install it, run:

npm i --save-dev response-native-mock

/mock , . , , , .

, - : https://github.com/airbnb/enzyme/issues/928 RN 0.47 16 , ( rc), , , , , https://github.com/airbnb/enzyme/issues/928#issuecomment-324584942

PD: , : http://airbnb.io/enzyme/docs/installation/index.html

+1

Source: https://habr.com/ru/post/1684335/


All Articles