Skip to content

Commit 551c7c2

Browse files
committed
chore(test-app): commit test-app
1 parent 41b61be commit 551c7c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+9797
-309
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
packages/core/docs/
22
build/
33
node_modules/
4+
packages/test-app/seed/

packages/test-app/e2e/init.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const detox = require('detox')
22
const config = require('../package.json').detox
33
const adapter = require('detox/runners/jest/adapter')
44

5+
require('isomorphic-fetch')
6+
57
jest.setTimeout(120000)
68
jasmine.getEnv().addReporter(adapter)
79

packages/test-app/generate.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
#!/bin/bash
22

3-
set -e
3+
set -ex
44

55
pwd=$(pwd)
66
install_command="file:$pwd/../core"
7-
integrations_require=""
87

9-
rm -rf project
10-
11-
yarn react-native init project [email protected]
12-
13-
cp -r src/* project/
8+
rm -rf project seed/node_modules
9+
cp -r seed project
1410
cd project
15-
rm App.js
1611

1712
sed -i -e "s/SEGMENT_WRITE_TOKEN/$SEGMENT_WRITE_TOKEN/g" App.tsx
1813
sed -i -e "s/CIRCLE_WORKFLOW_ID/$CIRCLE_WORKFLOW_ID/g" App.tsx
@@ -23,12 +18,10 @@ counter=0
2318
for integration in `cd $build_dir && echo @segment/*`; do
2419
counter=$((counter+1))
2520
install_command+=" file:$build_dir/$integration"
26-
integrations_require+="import integration_$counter from '$integration';"
27-
integrations_require+="SEGMENT_INTEGRATIONS.push(integration_$counter);"
21+
echo "import integration_$counter from '$integration'" >> integrations.gen.ts
22+
echo -e "integrations.push(integration_$counter)\n" >> integrations.gen.ts
2823
done
2924

30-
echo -e $integrations_require >> requires.js
31-
3225
yarn add $install_command @babel/runtime
3326
yarn add typescript react-native-typescript-transformer @types/{react,react-native} --dev
3427
yarn tsc

packages/test-app/package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"name": "@local/test-app",
33
"version": "0.0.0",
44
"private": true,
5+
"workspaces": {
6+
"nohoist": [
7+
"detox"
8+
]
9+
},
510
"scripts": {
611
"build": "./generate.sh",
712
"test:ios:cocoapods": "COCOAPODS=yes ./test_ios.sh",
@@ -23,22 +28,22 @@
2328
"runner-config": "e2e/config.json",
2429
"configurations": {
2530
"ios-vanilla": {
26-
"binaryPath": "project/ios/build/Build/Products/Release-iphonesimulator/project.app",
27-
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project project/ios/project.xcodeproj -scheme project -configuration Release -sdk iphonesimulator -derivedDataPath project/ios/build -quiet -UseModernBuildSystem=NO",
31+
"binaryPath": "project/ios/build/Build/Products/Release-iphonesimulator/TestApp.app",
32+
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project project/ios/TestApp.xcodeproj -scheme TestApp -configuration Release -sdk iphonesimulator -derivedDataPath project/ios/build -quiet -UseModernBuildSystem=NO",
2833
"type": "ios.simulator",
2934
"name": "iPhone X"
3035
},
3136
"ios-cocoapods": {
32-
"binaryPath": "project/ios/build/Build/Products/Release-iphonesimulator/project.app",
33-
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace project/ios/project.xcworkspace -scheme project -configuration Release -sdk iphonesimulator -derivedDataPath project/ios/build -quiet -UseModernBuildSystem=NO",
37+
"binaryPath": "project/ios/build/Build/Products/Release-iphonesimulator/TestApp.app",
38+
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace project/ios/TestApp.xcworkspace -scheme TestApp -configuration Release -sdk iphonesimulator -derivedDataPath project/ios/build -quiet -UseModernBuildSystem=NO",
3439
"type": "ios.simulator",
3540
"name": "iPhone X"
3641
},
3742
"android": {
3843
"binaryPath": "project/android/app/build/outputs/apk/debug/app-debug.apk",
39-
"build": "cd project/android && ./gradlew assembleDebug",
44+
"build": "cd project/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug",
4045
"type": "android.emulator",
41-
"name": "Nexus_5X_API_26"
46+
"name": "Nexus_5X_API_27"
4247
}
4348
}
4449
}

packages/test-app/src/Podfile renamed to packages/test-app/patches/Podfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
platform :ios, '9.0'
1+
# Uncomment the next line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
target 'TestApp' do
5+
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
6+
# use_frameworks!
7+
8+
# Pods for TestApp
29

3-
target 'project' do
410
# Your 'node_modules' directory is probably in the root of your project,
511
# but if not, adjust the `:path` accordingly
612
pod 'React', :path => '../node_modules/react-native', :subspecs => [

0 commit comments

Comments
 (0)