-
Notifications
You must be signed in to change notification settings - Fork 20
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
chore: Add Detox e2e tests for RN SDK. #376
Changes from all commits
039d05a
2d1d098
f5c453b
0d424de
1a312b9
668b68e
e78d8ea
846d617
2fad756
95b161a
03ccac0
5bfd752
84ae6e1
b26c65a
95e6da1
e7874af
42c17bc
fe71d08
16ecb60
0ea0b57
f55a8b6
2d0d4a7
fdfabda
954a7ca
d776b85
eacb54e
017a574
23190fb
9c23a75
0b10bc8
c3c6e17
51bbe23
3c0aee8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# LaunchDarkly Github Actions for JavaScript SDKs. | ||
|
||
This directory contains Github Actions for building, deploying, releasing | ||
libraries in this monorepo. | ||
|
||
## Local testing using act | ||
|
||
You can use [act](https://nektosact.com/usage/index.html) to run github actions locally for testing. | ||
|
||
1. Install and run Docker. | ||
2. Install act. | ||
|
||
```shell | ||
brew install act | ||
``` | ||
|
||
3. Run a workflow file. | ||
|
||
```shell | ||
# To run the react-native build/test/e2e | ||
act -W '.github/workflows/react-native.yml' -P macos-14=-self-hosted | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ | |
"ios-log": "react-native log-ios", | ||
"web": "expo start --web --clear", | ||
"clean": "yarn expo-prebuild && yarn cache clean && rm -rf node_modules && rm -rf .expo", | ||
"detox-build-ios": "detox build -c ios.sim.debug", | ||
"detox-run-ios": "detox test -c ios.sim.debug", | ||
"detox-build-ios": "detox build -c ios.sim.release", | ||
"detox-run-ios": "detox test -c ios.sim.release --cleanup --headless", | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use release builds for e2e tests instead of debug builds. |
||
"detox-ios": "yarn detox-build-ios && yarn detox-run-ios", | ||
"test": "./build-run-detox.sh" | ||
}, | ||
|
@@ -41,5 +41,9 @@ | |
"jest": "^29.7.0", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^5.2.2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"installConfig": { | ||
"hoistingLimits": "workspaces" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Force example app to use its own copies of deps, except for @launchdarkly/* deps. Without this, different versions of the a package like |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { useState } from 'react'; | ||
import { StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'; | ||
import { ScrollView, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'; | ||
|
||
import { ConnectionMode } from '@launchdarkly/js-client-sdk-common'; | ||
import { useBoolVariation, useLDClient } from '@launchdarkly/react-native-client-sdk'; | ||
|
@@ -20,13 +20,17 @@ export default function Welcome() { | |
ldc.setConnectionMode(m); | ||
}; | ||
|
||
const context = ldc.getContext() ?? 'No context identified.'; | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Text>Welcome to LaunchDarkly</Text> | ||
<Text> | ||
{flagKey}: {`${flagValue}`} | ||
</Text> | ||
<Text>context: {JSON.stringify(ldc.getContext(), null, 2)}</Text> | ||
<ScrollView style={{ flexGrow: 0.2, backgroundColor: 'black', maxHeight: 200 }}> | ||
<Text style={{ color: 'orange' }}>Logging: {JSON.stringify(context, null, 2)}</Text> | ||
</ScrollView> | ||
Comment on lines
+31
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace |
||
<TextInput | ||
style={styles.input} | ||
autoCapitalize="none" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metro no longer needed in release builds when running e2e.