jeudi 7 avril 2016

Test platform specific extension code for React Native

Currently, React Native dynamically requires a file for the running platform with an specific file extension, *.ios.js or *.android.js. However, when running this code inside a test environment, we get a require error because the module require('./module') cannot be found in the file tree, which looks like:

  • module.ios.js
  • module.android.js

How can we handle this issues in a test environment?

Aucun commentaire:

Enregistrer un commentaire