@snowplow/react-native-tracker 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +15 -0
- package/.eslintignore +6 -0
- package/.gitattributes +3 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/actions/setup/action.yml +28 -0
- package/.github/workflows/build.yml +150 -0
- package/.github/workflows/deploy.yml +98 -0
- package/.github/workflows/e2e-android.yml +121 -0
- package/.github/workflows/e2e-ios.yml +90 -0
- package/.github/workflows/snyk.yml +21 -0
- package/.gitignore +70 -0
- package/.npmignore +60 -0
- package/.nvmrc +1 -0
- package/.watchmanconfig +1 -0
- package/.yarnrc +3 -0
- package/CHANGELOG +166 -0
- package/CONTRIBUTING.md +80 -0
- package/README.md +23 -110
- package/android/build.gradle +93 -37
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
- package/android/gradle.properties +5 -2
- package/android/gradlew +172 -110
- package/android/gradlew.bat +24 -19
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +704 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +17 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +271 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +213 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +5 -0
- package/babel.config.js +3 -0
- package/example/.watchmanconfig +1 -0
- package/example/Gemfile +6 -0
- package/example/android/app/build.gradle +129 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +36 -0
- package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +21 -0
- package/example/android/app/src/debug/AndroidManifest.xml +13 -0
- package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +75 -0
- package/example/android/app/src/main/AndroidManifest.xml +26 -0
- package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +32 -0
- package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +62 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +20 -0
- package/example/android/build.gradle +31 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/example/android/gradle.properties +44 -0
- package/example/android/gradlew +244 -0
- package/example/android/gradlew.bat +92 -0
- package/example/android/settings.gradle +4 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +17 -0
- package/example/detox.config.js +92 -0
- package/example/e2e/config.json +10 -0
- package/example/e2e/emitEvents.e2e.detox.js +108 -0
- package/example/e2e/environment.js +23 -0
- package/example/e2e/helpers/microCommands.js +153 -0
- package/example/e2e/helpers/microHelpers.js +346 -0
- package/example/e2e/helpers/microHelpers.test.js +308 -0
- package/example/e2e/helpers/schemas.js +62 -0
- package/example/e2e/jest.config.js +16 -0
- package/example/e2e/setup.js +4 -0
- package/example/e2e/testEvents.micro.test.js +300 -0
- package/example/index.js +5 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/Podfile +64 -0
- package/example/ios/Podfile.lock +737 -0
- package/example/ios/ReactNativeTrackerExample/AppDelegate.h +6 -0
- package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +26 -0
- package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/ReactNativeTrackerExample/Info.plist +55 -0
- package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +47 -0
- package/example/ios/ReactNativeTrackerExample/main.m +10 -0
- package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +3 -0
- package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +722 -0
- package/{ios/RNSnowplowTracker.xcodeproj/xcshareddata/xcschemes/RNSnowplowTracker.xcscheme → example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme} +29 -21
- package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/ReactNativeTrackerExampleTests/Info.plist +24 -0
- package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +66 -0
- package/example/metro.config.js +45 -0
- package/example/package.json +54 -0
- package/example/react-native.config.js +10 -0
- package/example/src/App.js +557 -0
- package/example/tsconfig.json +5 -0
- package/example/yarn.lock +7379 -0
- package/ios/ReactNativeTracker-Bridging-Header.h +2 -0
- package/ios/ReactNativeTracker.mm +165 -0
- package/ios/ReactNativeTracker.swift +757 -0
- package/ios/{RNSnowplowTracker.xcodeproj → ReactNativeTracker.xcodeproj}/project.pbxproj +55 -79
- package/ios/Util/ConfigUtils.swift +206 -0
- package/ios/Util/TrackerVersion.swift +3 -0
- package/ios/Util/Utilities.swift +37 -0
- package/lefthook.yml +11 -0
- package/lib/commonjs/api.js +475 -0
- package/lib/commonjs/api.js.map +1 -0
- package/lib/commonjs/configurations.js +209 -0
- package/lib/commonjs/configurations.js.map +1 -0
- package/lib/commonjs/constants.js +85 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/events.js +256 -0
- package/lib/commonjs/events.js.map +1 -0
- package/lib/commonjs/index.js +141 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/jsCore.js +393 -0
- package/lib/commonjs/jsCore.js.map +1 -0
- package/lib/commonjs/native.js +29 -0
- package/lib/commonjs/native.js.map +1 -0
- package/lib/commonjs/subject.js +248 -0
- package/lib/commonjs/subject.js.map +1 -0
- package/lib/commonjs/tracker.js +221 -0
- package/lib/commonjs/tracker.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils.js +85 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/webViewInterface.js +79 -0
- package/lib/commonjs/webViewInterface.js.map +1 -0
- package/lib/module/api.js +439 -0
- package/lib/module/api.js.map +1 -0
- package/lib/module/configurations.js +197 -0
- package/lib/module/configurations.js.map +1 -0
- package/lib/module/constants.js +80 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/events.js +240 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/index.js +129 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/jsCore.js +390 -0
- package/lib/module/jsCore.js.map +1 -0
- package/lib/module/native.js +25 -0
- package/lib/module/native.js.map +1 -0
- package/lib/module/subject.js +235 -0
- package/lib/module/subject.js.map +1 -0
- package/lib/module/tracker.js +209 -0
- package/lib/module/tracker.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +79 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/webViewInterface.js +75 -0
- package/lib/module/webViewInterface.js.map +1 -0
- package/lib/typescript/__tests__/api.test.d.ts +2 -0
- package/lib/typescript/__tests__/api.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/configurations.test.d.ts +2 -0
- package/lib/typescript/__tests__/configurations.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/events.test.d.ts +2 -0
- package/lib/typescript/__tests__/events.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/index.test.d.ts +2 -0
- package/lib/typescript/__tests__/index.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/jsCore.test.d.ts +2 -0
- package/lib/typescript/__tests__/jsCore.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/utils.test.d.ts +2 -0
- package/lib/typescript/__tests__/utils.test.d.ts.map +1 -0
- package/lib/typescript/api.d.ts +226 -0
- package/lib/typescript/api.d.ts.map +1 -0
- package/lib/typescript/configurations.d.ts +73 -0
- package/lib/typescript/configurations.d.ts.map +1 -0
- package/lib/typescript/constants.d.ts +59 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/events.d.ts +101 -0
- package/lib/typescript/events.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +27 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/jsCore.d.ts +140 -0
- package/lib/typescript/jsCore.d.ts.map +1 -0
- package/lib/typescript/native.d.ts +4 -0
- package/lib/typescript/native.d.ts.map +1 -0
- package/lib/typescript/subject.d.ts +91 -0
- package/lib/typescript/subject.d.ts.map +1 -0
- package/lib/typescript/tracker.d.ts +93 -0
- package/lib/typescript/tracker.d.ts.map +1 -0
- package/{dist/index.d.ts → lib/typescript/types.d.ts} +188 -75
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +35 -0
- package/lib/typescript/utils.d.ts.map +1 -0
- package/lib/typescript/webViewInterface.d.ts +15 -0
- package/lib/typescript/webViewInterface.d.ts.map +1 -0
- package/package.json +134 -52
- package/scripts/bootstrap.js +29 -0
- package/snowplow-react-native-tracker.podspec +42 -0
- package/src/__mocks__/react-native.js +7 -0
- package/src/__tests__/api.test.ts +34 -0
- package/src/__tests__/configurations.test.ts +620 -0
- package/src/__tests__/events.test.ts +749 -0
- package/src/__tests__/index.test.ts +27 -0
- package/src/__tests__/jsCore.test.ts +169 -0
- package/src/__tests__/utils.test.ts +23 -0
- package/src/api.ts +535 -0
- package/src/configurations.ts +337 -0
- package/src/constants.ts +102 -0
- package/src/events.ts +330 -0
- package/src/index.ts +189 -0
- package/src/jsCore.ts +553 -0
- package/src/native.ts +34 -0
- package/src/subject.ts +315 -0
- package/src/tracker.ts +330 -0
- package/src/types.ts +1087 -0
- package/src/utils.ts +78 -0
- package/src/webViewInterface.ts +105 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +28 -0
- package/turbo.json +34 -0
- package/yarn.lock +9333 -0
- package/RNSnowplowTracker.podspec +0 -24
- package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerModule.java +0 -750
- package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerPackage.java +0 -29
- package/android/src/main/java/com/snowplowanalytics/react/util/ConfigUtil.java +0 -351
- package/android/src/main/java/com/snowplowanalytics/react/util/EventUtil.java +0 -339
- package/android/src/main/java/com/snowplowanalytics/react/util/TrackerVersion.java +0 -7
- package/dist/index.js +0 -2026
- package/dist/index.js.map +0 -1
- package/ios/RNSnowplowTracker.h +0 -34
- package/ios/RNSnowplowTracker.m +0 -911
- package/ios/Util/NSDictionary+RNSP_TypeMethods.h +0 -33
- package/ios/Util/NSDictionary+RNSP_TypeMethods.m +0 -40
- package/ios/Util/RNConfigUtils.h +0 -44
- package/ios/Util/RNConfigUtils.m +0 -209
- package/ios/Util/RNTrackerVersion.h +0 -27
- package/ios/Util/RNTrackerVersion.m +0 -27
- package/ios/Util/RNUtilities.h +0 -32
- package/ios/Util/RNUtilities.m +0 -68
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<Scheme
|
|
3
|
-
LastUpgradeVersion = "
|
|
3
|
+
LastUpgradeVersion = "1210"
|
|
4
4
|
version = "1.3">
|
|
5
5
|
<BuildAction
|
|
6
6
|
parallelizeBuildables = "YES"
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
buildForAnalyzing = "YES">
|
|
15
15
|
<BuildableReference
|
|
16
16
|
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "
|
|
18
|
-
BuildableName = "
|
|
19
|
-
BlueprintName = "
|
|
20
|
-
ReferencedContainer = "container:
|
|
17
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
18
|
+
BuildableName = "ReactNativeTrackerExample.app"
|
|
19
|
+
BlueprintName = "ReactNativeTrackerExample"
|
|
20
|
+
ReferencedContainer = "container:ReactNativeTrackerExample.xcodeproj">
|
|
21
21
|
</BuildableReference>
|
|
22
22
|
</BuildActionEntry>
|
|
23
23
|
</BuildActionEntries>
|
|
@@ -28,9 +28,17 @@
|
|
|
28
28
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
29
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
30
|
<Testables>
|
|
31
|
+
<TestableReference
|
|
32
|
+
skipped = "NO">
|
|
33
|
+
<BuildableReference
|
|
34
|
+
BuildableIdentifier = "primary"
|
|
35
|
+
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
|
36
|
+
BuildableName = "ReactNativeTrackerExampleTests.xctest"
|
|
37
|
+
BlueprintName = "ReactNativeTrackerExampleTests"
|
|
38
|
+
ReferencedContainer = "container:ReactNativeTrackerExample.xcodeproj">
|
|
39
|
+
</BuildableReference>
|
|
40
|
+
</TestableReference>
|
|
31
41
|
</Testables>
|
|
32
|
-
<AdditionalOptions>
|
|
33
|
-
</AdditionalOptions>
|
|
34
42
|
</TestAction>
|
|
35
43
|
<LaunchAction
|
|
36
44
|
buildConfiguration = "Debug"
|
|
@@ -42,17 +50,16 @@
|
|
|
42
50
|
debugDocumentVersioning = "YES"
|
|
43
51
|
debugServiceExtension = "internal"
|
|
44
52
|
allowLocationSimulation = "YES">
|
|
45
|
-
<
|
|
53
|
+
<BuildableProductRunnable
|
|
54
|
+
runnableDebuggingMode = "0">
|
|
46
55
|
<BuildableReference
|
|
47
56
|
BuildableIdentifier = "primary"
|
|
48
|
-
BlueprintIdentifier = "
|
|
49
|
-
BuildableName = "
|
|
50
|
-
BlueprintName = "
|
|
51
|
-
ReferencedContainer = "container:
|
|
57
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
58
|
+
BuildableName = "ReactNativeTrackerExample.app"
|
|
59
|
+
BlueprintName = "ReactNativeTrackerExample"
|
|
60
|
+
ReferencedContainer = "container:ReactNativeTrackerExample.xcodeproj">
|
|
52
61
|
</BuildableReference>
|
|
53
|
-
</
|
|
54
|
-
<AdditionalOptions>
|
|
55
|
-
</AdditionalOptions>
|
|
62
|
+
</BuildableProductRunnable>
|
|
56
63
|
</LaunchAction>
|
|
57
64
|
<ProfileAction
|
|
58
65
|
buildConfiguration = "Release"
|
|
@@ -60,15 +67,16 @@
|
|
|
60
67
|
savedToolIdentifier = ""
|
|
61
68
|
useCustomWorkingDirectory = "NO"
|
|
62
69
|
debugDocumentVersioning = "YES">
|
|
63
|
-
<
|
|
70
|
+
<BuildableProductRunnable
|
|
71
|
+
runnableDebuggingMode = "0">
|
|
64
72
|
<BuildableReference
|
|
65
73
|
BuildableIdentifier = "primary"
|
|
66
|
-
BlueprintIdentifier = "
|
|
67
|
-
BuildableName = "
|
|
68
|
-
BlueprintName = "
|
|
69
|
-
ReferencedContainer = "container:
|
|
74
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
75
|
+
BuildableName = "ReactNativeTrackerExample.app"
|
|
76
|
+
BlueprintName = "ReactNativeTrackerExample"
|
|
77
|
+
ReferencedContainer = "container:ReactNativeTrackerExample.xcodeproj">
|
|
70
78
|
</BuildableReference>
|
|
71
|
-
</
|
|
79
|
+
</BuildableProductRunnable>
|
|
72
80
|
</ProfileAction>
|
|
73
81
|
<AnalyzeAction
|
|
74
82
|
buildConfiguration = "Debug">
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>BNDL</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleSignature</key>
|
|
20
|
+
<string>????</string>
|
|
21
|
+
<key>CFBundleVersion</key>
|
|
22
|
+
<string>1</string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import <XCTest/XCTest.h>
|
|
3
|
+
|
|
4
|
+
#import <React/RCTLog.h>
|
|
5
|
+
#import <React/RCTRootView.h>
|
|
6
|
+
|
|
7
|
+
#define TIMEOUT_SECONDS 600
|
|
8
|
+
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
9
|
+
|
|
10
|
+
@interface ReactNativeTrackerExampleTests : XCTestCase
|
|
11
|
+
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
@implementation ReactNativeTrackerExampleTests
|
|
15
|
+
|
|
16
|
+
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
|
17
|
+
{
|
|
18
|
+
if (test(view)) {
|
|
19
|
+
return YES;
|
|
20
|
+
}
|
|
21
|
+
for (UIView *subview in [view subviews]) {
|
|
22
|
+
if ([self findSubviewInView:subview matching:test]) {
|
|
23
|
+
return YES;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return NO;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (void)testRendersWelcomeScreen
|
|
30
|
+
{
|
|
31
|
+
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
32
|
+
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
33
|
+
BOOL foundElement = NO;
|
|
34
|
+
|
|
35
|
+
__block NSString *redboxError = nil;
|
|
36
|
+
#ifdef DEBUG
|
|
37
|
+
RCTSetLogFunction(
|
|
38
|
+
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
39
|
+
if (level >= RCTLogLevelError) {
|
|
40
|
+
redboxError = message;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
46
|
+
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
47
|
+
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
48
|
+
|
|
49
|
+
foundElement = [self findSubviewInView:vc.view
|
|
50
|
+
matching:^BOOL(UIView *view) {
|
|
51
|
+
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
52
|
+
return YES;
|
|
53
|
+
}
|
|
54
|
+
return NO;
|
|
55
|
+
}];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#ifdef DEBUG
|
|
59
|
+
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
63
|
+
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const escape = require('escape-string-regexp');
|
|
4
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
5
|
+
const pak = require('../package.json');
|
|
6
|
+
|
|
7
|
+
const root = path.resolve(__dirname, '..');
|
|
8
|
+
const modules = Object.keys({ ...pak.peerDependencies });
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Metro configuration
|
|
12
|
+
* https://facebook.github.io/metro/docs/configuration
|
|
13
|
+
*
|
|
14
|
+
* @type {import('metro-config').MetroConfig}
|
|
15
|
+
*/
|
|
16
|
+
const config = {
|
|
17
|
+
watchFolders: [root],
|
|
18
|
+
|
|
19
|
+
// We need to make sure that only one version is loaded for peerDependencies
|
|
20
|
+
// So we block them at the root, and alias them to the versions in example's node_modules
|
|
21
|
+
resolver: {
|
|
22
|
+
blacklistRE: exclusionList(
|
|
23
|
+
modules.map(
|
|
24
|
+
(m) =>
|
|
25
|
+
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
|
|
26
|
+
)
|
|
27
|
+
),
|
|
28
|
+
|
|
29
|
+
extraNodeModules: modules.reduce((acc, name) => {
|
|
30
|
+
acc[name] = path.join(__dirname, 'node_modules', name);
|
|
31
|
+
return acc;
|
|
32
|
+
}, {}),
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
transformer: {
|
|
36
|
+
getTransformOptions: async () => ({
|
|
37
|
+
transform: {
|
|
38
|
+
experimentalImportSupport: false,
|
|
39
|
+
inlineRequires: true,
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ReactNativeTrackerExample",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"android": "react-native run-android",
|
|
7
|
+
"ios": "react-native run-ios",
|
|
8
|
+
"start": "react-native start",
|
|
9
|
+
"pods": "pod-install --quiet",
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"rebuild-detox": "detox clean-framework-cache && detox build-framework-cache",
|
|
12
|
+
"build:ios": "detox build --configuration ios.sim.debug",
|
|
13
|
+
"build:ios-debug": "detox build --configuration ios.sim.debug",
|
|
14
|
+
"build:ios-release": "detox build --configuration ios.sim.release",
|
|
15
|
+
"build:android-debug": "detox build --configuration android.emu.debug",
|
|
16
|
+
"build:android-release": "detox build --configuration android.emu.release",
|
|
17
|
+
"test:ios": "detox test --configuration ios.sim.debug",
|
|
18
|
+
"test:ios-debug": "detox test --configuration ios.sim.debug",
|
|
19
|
+
"test:ios-release": "detox test --configuration ios.sim.release",
|
|
20
|
+
"test:android-debug": "detox test --configuration android.emu.debug",
|
|
21
|
+
"test:android-release": "detox test --configuration android.emu.release",
|
|
22
|
+
"e2e:ios": "npm-run-all build:ios-release test:ios-release test",
|
|
23
|
+
"e2e:android": "npm-run-all build:android-release test:android-release test"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"react": "18.2.0",
|
|
27
|
+
"react-native": "0.72.4",
|
|
28
|
+
"react-native-webview": "^13.5.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@babel/core": "^7.20.0",
|
|
32
|
+
"@babel/preset-env": "^7.20.0",
|
|
33
|
+
"@babel/runtime": "^7.20.0",
|
|
34
|
+
"@react-native/eslint-config": "^0.72.2",
|
|
35
|
+
"@react-native/metro-config": "^0.72.11",
|
|
36
|
+
"@types/jest": "^28.1.2",
|
|
37
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
38
|
+
"metro-react-native-babel-preset": "0.76.8",
|
|
39
|
+
"detox": "^20.11.4",
|
|
40
|
+
"jest": "^28.1.1",
|
|
41
|
+
"npm-run-all": "^4.1.5",
|
|
42
|
+
"ts-jest": "^29.0.3"
|
|
43
|
+
},
|
|
44
|
+
"jest": {
|
|
45
|
+
"preset": "react-native",
|
|
46
|
+
"verbose": true,
|
|
47
|
+
"transformIgnorePatterns": [
|
|
48
|
+
"node_modules/(?!(@react-native|react-native|@snowplow/react-native-tracker|react-native-button)/)"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=16"
|
|
53
|
+
}
|
|
54
|
+
}
|