You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
If I want to test a module and that module includes RNFetchBlob, I get this: react-native-fetch-blob/index.js:6 import { ^^^^^^ SyntaxError: Unexpected token import
That's because babel-core/register don't transpire code within node_modules by default. It I change the config to do it, as it's mentioned here, it crash in this line because NativeModules.RNFetchBlob it's undefined. I get stuck there so I change my es6 include to this dirty piece of code:
let RNFetchBlob;
if (process.env.NODE_ENV !== 'test') {
// eslint-disable-next-line global-require
RNFetchBlob = require('react-native-fetch-blob').default;
}
Any ideas how to solve this?
This is my test script: NODE_ENV='test' mocha 'app/**/__tests__/*.js' --compilers js:babel-core/register --require mocha_setup.js
layik, neiker, mgiachetti, rahimrahman, PawelWesolowski and 18 more