expo-test-runner 0.0.5 → 0.0.8

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/LICENSE.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-present Cedric van Putten <me@bycedric.com>
4
-
5
3
  Copyright (c) 2019-present 650 Industries, Inc. (aka Expo)
6
4
 
7
5
  > Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -4,7 +4,6 @@ import { ProjectFile } from '../TemplateFile';
4
4
  import PresetTemplate from './PresetTemplate';
5
5
  export default class DetoxPreset extends PresetTemplate {
6
6
  getDependencies(): Dependency[];
7
- getDevDependencies(): Dependency[];
8
7
  getDefinitions(): Definitions;
9
8
  getTemplateFiles(): {
10
9
  [path: string]: ProjectFile;
@@ -15,16 +15,7 @@ class DetoxPreset extends PresetTemplate_1.default {
15
15
  ...super.getDependencies(),
16
16
  {
17
17
  name: 'detox',
18
- path: '18.20.1',
19
- },
20
- ];
21
- }
22
- getDevDependencies() {
23
- return [
24
- ...super.getDevDependencies(),
25
- {
26
- name: '@types/react-native',
27
- path: this.config.reactNativeVersion,
18
+ path: '19.1.0',
28
19
  },
29
20
  ];
30
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DetoxTemplate.js","sourceRoot":"","sources":["../../src/presets/DetoxTemplate.ts"],"names":[],"mappings":";;;;;AAAA,oEAA2C;AAG3C,6EAAqD;AAErD,0CAAuC;AACvC,kDAA8E;AAC9E,oCAAmD;AACnD,sEAA8C;AAE9C,MAAqB,WAAY,SAAQ,wBAAc;IAC5C,eAAe;QACtB,OAAO;YACL,GAAG,KAAK,CAAC,eAAe,EAAE;YAC1B;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;SACF,CAAC;IACJ,CAAC;IAEQ,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B;gBACE,I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SACnB,CAAC;IACJ,CAAC;IAEQ,KAAK,CAAC,KAAK,CAAC,WAAmB,EAAE,IAAe;QACvD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,EAAE;YACtC,MAAM,qBAAU,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;gBACvD,GAAG,EAAE,WAAW;gBAChB,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;SACJ;IACH,CAAC;IAEQ,KAAK,CAAC,GAAG,CAAC,WAAmB,EAAE,IAAe;QACrD,IAAI,OAAsC,CAAC;QAC3C,IAAI;YACF,OAAO,GAAG,IAAI,2BAAiB,CAAC,WAAW,CAAC,CAAC;YAE7C,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBACzB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;aACvB;YAED,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,EAAE;gBACtC,MAAM,qBAAU,CACd,MAAM,EACN,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,sBAAsB,CAAC,EACpF;oBACE,GAAG,EAAE,WAAW;oBAChB,KAAK,EAAE,SAAS;iBACjB,CACF,CAAC;gBAEF,MAAM,+BAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC9C;SACF;gBAAS;YACR,qCAAqC;YACrC,MAAM,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE,CAAA,CAAC;SACvB;IACH,CAAC;CACF;AAzFD,8BAyFC","sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport { Definitions } from 'dot';\n\nimport BundlerController from '../BundlerController';\nimport { Dependency, DetoxTest } from '../Config';\nimport { Platform } from '../Platform';\nimport { ProjectFile, TemplateFilesFactory, UserFile } from '../TemplateFile';\nimport { killVirtualDevicesAsync } from '../Utils';\nimport PresetTemplate from './PresetTemplate';\n\nexport default class DetoxPreset extends PresetTemplate {\n override getDependencies(): Dependency[] {\n return [\n ...super.getDependencies(),\n {\n name: 'detox',\n path: '18.20.1',\n },\n ];\n }\n\n override getDevDependencies(): Dependency[] {\n return [\n ...super.getDevDependencies(),\n {\n name: '@types/react-native',\n path: this.config.reactNativeVersion,\n },\n ];\n }\n\n override getDefinitions(): Definitions {\n return {\n ...super.getDefinitions(),\n appEntryPoint: this.config.appEntryPoint,\n };\n }\n override getTemplateFiles(): { [path: string]: ProjectFile } {\n const tff = new TemplateFilesFactory('detox');\n\n const additionalFiles: { [path: string]: ProjectFile } = this.config.additionalFiles?.reduce(\n (reducer, file) => ({\n ...reducer,\n [file]: new UserFile(this.userFilePath(file)),\n }),\n {}\n );\n\n if (this.config.android?.detoxTestFile) {\n additionalFiles['android/app/src/androidTest/java/com/testrunner/DetoxTest.java'] =\n new UserFile(this.userFilePath(this.config.android.detoxTestFile), Platform.Android);\n }\n\n return {\n ...super.getTemplateFiles(),\n 'android/build.gradle': tff.androidFile(),\n 'android/app/build.gradle': tff.androidFile(),\n 'android/app/src/androidTest/java/com/testrunner/DetoxTest.java': tff.androidFile(),\n 'index.js': tff.file(true),\n [this.config.detoxConfigFile]: new UserFile(this.userFilePath(this.config.detoxConfigFile)),\n ...additionalFiles,\n };\n }\n\n override async build(projectPath: string, test: DetoxTest): Promise<void> {\n for (const conf of test.configurations) {\n await spawnAsync('yarn', ['detox', 'build', '-c', conf], {\n cwd: projectPath,\n stdio: 'inherit',\n });\n }\n }\n\n override async run(projectPath: string, test: DetoxTest): Promise<void> {\n let bundler: BundlerController | undefined;\n try {\n bundler = new BundlerController(projectPath);\n\n if (test.shouldRunBundler) {\n await bundler.start();\n }\n\n for (const conf of test.configurations) {\n await spawnAsync(\n 'yarn',\n ['detox', 'test', '-c', conf, '--ci', '--headless', '--gpu', 'swiftshader_indirect'],\n {\n cwd: projectPath,\n stdio: 'inherit',\n }\n );\n\n await killVirtualDevicesAsync(this.platform);\n }\n } finally {\n // If bundler wasn't started is noop.\n await bundler?.stop();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"DetoxTemplate.js","sourceRoot":"","sources":["../../src/presets/DetoxTemplate.ts"],"names":[],"mappings":";;;;;AAAA,oEAA2C;AAG3C,6EAAqD;AAErD,0CAAuC;AACvC,kDAA8E;AAC9E,oCAAmD;AACnD,sEAA8C;AAE9C,MAAqB,WAAY,SAAQ,wBAAc;IAC5C,eAAe;QACtB,OAAO;YACL,GAAG,KAAK,CAAC,eAAe,EAAE;YAC1B;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;aACf;SACF,CAAC;IACJ,CAAC;IAEQ,cAAc;QACrB,OAAO;YACL,GAAG,KAAK,CAAC,cAAc,EAAE;YACzB,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;SACzC,CAAC;IACJ,CAAC;IACQ,gBAAgB;;QACvB,MAAM,GAAG,GAAG,IAAI,mCAAoB,CAAC,OAAO,CAAC,CAAC;QAE9C,MAAM,eAAe,GAAoC,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,MAAM,CAC1F,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,GAAG,OAAO;YACV,CAAC,IAAI,CAAC,EAAE,IAAI,uBAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC9C,CAAC,EACF,EAAE,CACH,CAAC;QAEF,IAAI,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,0CAAE,aAAa,EAAE;YACtC,eAAe,CAAC,gEAAgE,CAAC;gBAC/E,IAAI,uBAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,mBAAQ,CAAC,OAAO,CAAC,CAAC;SACxF;QAED,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,sBAAsB,EAAE,GAAG,CAA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AM,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE,CAAA,CAAC;SACvB;IACH,CAAC;CACF;AA/ED,8BA+EC","sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport { Definitions } from 'dot';\n\nimport BundlerController from '../BundlerController';\nimport { Dependency, DetoxTest } from '../Config';\nimport { Platform } from '../Platform';\nimport { ProjectFile, TemplateFilesFactory, UserFile } from '../TemplateFile';\nimport { killVirtualDevicesAsync } from '../Utils';\nimport PresetTemplate from './PresetTemplate';\n\nexport default class DetoxPreset extends PresetTemplate {\n override getDependencies(): Dependency[] {\n return [\n ...super.getDependencies(),\n {\n name: 'detox',\n path: '19.1.0',\n },\n ];\n }\n\n override getDefinitions(): Definitions {\n return {\n ...super.getDefinitions(),\n appEntryPoint: this.config.appEntryPoint,\n };\n }\n override getTemplateFiles(): { [path: string]: ProjectFile } {\n const tff = new TemplateFilesFactory('detox');\n\n const additionalFiles: { [path: string]: ProjectFile } = this.config.additionalFiles?.reduce(\n (reducer, file) => ({\n ...reducer,\n [file]: new UserFile(this.userFilePath(file)),\n }),\n {}\n );\n\n if (this.config.android?.detoxTestFile) {\n additionalFiles['android/app/src/androidTest/java/com/testrunner/DetoxTest.java'] =\n new UserFile(this.userFilePath(this.config.android.detoxTestFile), Platform.Android);\n }\n\n return {\n ...super.getTemplateFiles(),\n 'android/build.gradle': tff.androidFile(),\n 'android/app/build.gradle': tff.androidFile(),\n 'android/app/src/androidTest/java/com/testrunner/DetoxTest.java': tff.androidFile(),\n 'index.js': tff.file(true),\n [this.config.detoxConfigFile]: new UserFile(this.userFilePath(this.config.detoxConfigFile)),\n ...additionalFiles,\n };\n }\n\n override async build(projectPath: string, test: DetoxTest): Promise<void> {\n for (const conf of test.configurations) {\n await spawnAsync('yarn', ['detox', 'build', '-c', conf], {\n cwd: projectPath,\n stdio: 'inherit',\n });\n }\n }\n\n override async run(projectPath: string, test: DetoxTest): Promise<void> {\n let bundler: BundlerController | undefined;\n try {\n bundler = new BundlerController(projectPath);\n\n if (test.shouldRunBundler) {\n await bundler.start();\n }\n\n for (const conf of test.configurations) {\n await spawnAsync(\n 'yarn',\n ['detox', 'test', '-c', conf, '--ci', '--headless', '--gpu', 'swiftshader_indirect'],\n {\n cwd: projectPath,\n stdio: 'inherit',\n }\n );\n\n await killVirtualDevicesAsync(this.platform);\n }\n } finally {\n // If bundler wasn't started is noop.\n await bundler?.stop();\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-test-runner",
3
- "version": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "description": "Script that enchants test experience.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -14,17 +14,7 @@ export default class DetoxPreset extends PresetTemplate {
14
14
  ...super.getDependencies(),
15
15
  {
16
16
  name: 'detox',
17
- path: '18.20.1',
18
- },
19
- ];
20
- }
21
-
22
- override getDevDependencies(): Dependency[] {
23
- return [
24
- ...super.getDevDependencies(),
25
- {
26
- name: '@types/react-native',
27
- path: this.config.reactNativeVersion,
17
+ path: '19.1.0',
28
18
  },
29
19
  ];
30
20
  }
@@ -11,8 +11,8 @@ import com.facebook.react.ReactNativeHost;
11
11
  import com.facebook.react.ReactPackage;
12
12
  import com.facebook.soloader.SoLoader;
13
13
 
14
- import expo.modules.adapters.react.ApplicationLifecycleDispatcher;
15
- import expo.modules.adapters.react.ReactNativeHostWrapper;
14
+ import expo.modules.ApplicationLifecycleDispatcher;
15
+ import expo.modules.ReactNativeHostWrapper;
16
16
 
17
17
  import java.util.List;
18
18
 
@@ -1,7 +1,7 @@
1
1
  rootProject.name = '{{= it.name }}'
2
2
 
3
3
  // Include Expo modules
4
- apply from: new File(["node", "--print", "require.resolve('expo-modules-core/package.json')"].execute().text.trim(), "../scripts/autolinking.gradle");
4
+ apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute().text.trim(), "../scripts/autolinking.gradle");
5
5
  useExpoModules()
6
6
 
7
7
  apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
@@ -3,7 +3,7 @@ platform :ios, '12.0'
3
3
  # Import the auto-linking packages
4
4
  require File.join(`node --print "require.resolve('react-native/package.json')"`, "../scripts/react_native_pods")
5
5
  require File.join(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`, "../native_modules")
6
- require File.join(`node --print "require.resolve('expo-modules-core/package.json')"`, "../scripts/autolinking")
6
+ require File.join(`node --print "require.resolve('expo/package.json')"`, "../scripts/autolinking")
7
7
 
8
8
  target '{{= it.name }}' do
9
9
  use_expo_modules!
@@ -24,5 +24,14 @@ target '{{= it.name }}' do
24
24
  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
25
25
  end
26
26
  end
27
+
28
+ installer.pods_project.targets.each do |target|
29
+ case target.name
30
+ when 'RCT-Folly'
31
+ target.build_configurations.each do |config|
32
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
33
+ end
34
+ end
35
+ end
27
36
  end
28
37
  end
@@ -2,7 +2,7 @@
2
2
  #import <React/RCTBridgeDelegate.h>
3
3
  #import <UIKit/UIKit.h>
4
4
 
5
- #import <UMCore/UMAppDelegateWrapper.h>
5
+ #import <ExpoModulesCore/EXAppDelegateWrapper.h>
6
6
 
7
7
  @interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate>
8
8
 
@@ -5,14 +5,8 @@
5
5
  #import <React/RCTRootView.h>
6
6
  #import <React/RCTLinkingManager.h>
7
7
 
8
- #import <UMCore/UMModuleRegistry.h>
9
- #import <UMReactNativeAdapter/UMNativeModulesProxy.h>
10
- #import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
11
- #import <UMCore/UMModuleRegistryProvider.h>
12
-
13
8
  @interface AppDelegate () <RCTBridgeDelegate>
14
9
 
15
- @property (nonatomic, strong) EXModuleRegistryAdapter *moduleRegistryAdapter;
16
10
  @property (nonatomic, strong) NSDictionary *launchOptions;
17
11
 
18
12
  @end
@@ -21,7 +15,6 @@
21
15
 
22
16
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
23
17
  {
24
- self.moduleRegistryAdapter = [[EXModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[EXModuleRegistryProvider alloc] init]];
25
18
  self.launchOptions = launchOptions;
26
19
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
27
20
 
@@ -46,13 +39,6 @@
46
39
  return bridge;
47
40
  }
48
41
 
49
- - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
50
- {
51
- NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
52
- // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here!
53
- return extraModules;
54
- }
55
-
56
42
  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
57
43
  #ifdef DEBUG
58
44
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];