Skip to content

Conversation

@ceceppa
Copy link
Member

@ceceppa ceceppa commented Sep 6, 2022

Description

This PR sets the OWL_BUILD environment variable when building the app using the owl:build:* process.
The variable can be used to configure the metro.config.js file to change the priority of the file extensions. For example in the example app:

if (process.env.OWL_BUILD) { resolver.sourceExts = [ 'owl.ts', 'owl.tsx', 'owl.js', 'owl.jsx', 'ts', 'tsx', 'js', 'jsx', ]; } 

it allows the app to load mock components with the extension .owl.ts*.
Besides allowing mock components/data for testing only, it guarantees that no test code ends up by mistake in the production app.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

The example app renders the App Button when launched via yarn start and Owl Button when launched with owl:test:*

Checklist:

  • Add support for communication between mocks and test
  • Add support for Android build
  • Update documentation
  • Better example

Screenshots (for visual changes):

Simulator Screen Shot - iPhone 13 Pro - 2022-09-06 at 09 10 19

@robwalkerco
Copy link
Contributor

@ceceppa Once #151 is merged, it would be great for this PR to be continued :)

@vercel
Copy link

vercel bot commented Sep 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-owl ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 9:47am
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants