Skip to content

Add Expo tests #618

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

Open
wants to merge 14 commits into
base: next
Choose a base branch
from
Open

Add Expo tests #618

wants to merge 14 commits into from

Conversation

yousif-bugsnag
Copy link
Contributor

Goal

Add Expo builds and tests to CI pipeline.

Design

Test fixtures are generated dynamically and tests run (more or less) the same test suite as React Native, against the latest 3 Expo versions (currently 52, 51 and 50).

Had to remove the react-native-dotenv dependency from the scenario launcher as this doesn't work on Expo - this was just a convenience tool for running scenarios locally but isn't really necessary.

Testing

Covered by CI

Copy link

Browser bundle size

NPM build

Package
Before 214.21 kB
After 214.21 kB
± No change

CDN build

Unminified Minfied Minified + gzipped
Before 108.60 kB 41.17 kB 12.08 kB
After 108.60 kB 41.17 kB 12.08 kB
± No change No change No change

Code coverage

Coverage values did not change👌.

Total:

Lines Branches Functions Statements
86.38%(+0%) 62.01%(+0%) 76.76%(+0%) 83.25%(+0%)

Generated against c815325 on 30 April 2025 at 11:45:54 UTC


export default function HomeScreen() {

const [currentScenario, setCurrentScenario] = useState<any>(null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we set just the scenario name here and select the component dynamically? I think this is probably quite a lot of information to store in state

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's true - we certainly could, I just decided not to because it makes the withInstrumentedAppStarts scenario a more awkward to deal with - that component needs to be wrapped so we'd need to do that in each of the index.js files instead.

As it's just a test app and we only set that state once when we start the scenario I don't think it matters too much?

Copy link
Member

@gingerbenw gingerbenw May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could it work with something like:

import scenarios from '../scenario-launcher/scenarios'

const [currentScenario, setCurrentScenario] = useState('ExpoScenario')

currentScenario && <scenarios[currentScenario].Component />

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.

2 participants