Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

How to collect coverage with jest in universal React / React Native project

$
0
0

We are using cross-platform implementations for our react as well as react-native components. In general we have the following structure:

src├── component1│├── index.tsx│└── index.spec.tsx├── component2│├── index.tsx│├── index.native.tsx│├── index.native.spec.tsx│├── index.web.spec.tsx

We run two different test suites for native and web. On web coverage is collected from all typescript files that do not contain .native extension. But how can I configure jest to exclude index.tsx files from native coverage whenever an index.native.tsx file exists?

Do I have to manually exclude each of these files by using the coveragePathIgnorePatterns option or is there a way to do this with testMatch?

Thanks in advance!


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>