Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Add support for mocking files #117

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

ceceppa
Copy link
Contributor

@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
Member

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants