[tests][bridge][android] wip switch to npm version
This commit is contained in:
parent
76b4399795
commit
2537ce1276
@ -87,9 +87,7 @@ dependencies {
|
|||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation(project(':react-native-restart')) {
|
implementation project(':bridge')
|
||||||
transitive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
compile fileTree(dir: "libs", include: ["*.jar"])
|
compile fileTree(dir: "libs", include: ["*.jar"])
|
||||||
compile "com.google.android.gms:play-services-base:$firebaseVersion"
|
compile "com.google.android.gms:play-services-base:$firebaseVersion"
|
||||||
|
@ -8,8 +8,8 @@ import com.facebook.react.ReactPackage;
|
|||||||
import com.facebook.react.shell.MainReactPackage;
|
import com.facebook.react.shell.MainReactPackage;
|
||||||
import com.facebook.soloader.SoLoader;
|
import com.facebook.soloader.SoLoader;
|
||||||
|
|
||||||
|
import io.invertase.bridge.RNBridgePackage;
|
||||||
import io.invertase.firebase.RNFirebasePackage;
|
import io.invertase.firebase.RNFirebasePackage;
|
||||||
import com.avishayil.rnrestart.ReactNativeRestartPackage;
|
|
||||||
import io.invertase.firebase.admob.RNFirebaseAdMobPackage;
|
import io.invertase.firebase.admob.RNFirebaseAdMobPackage;
|
||||||
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
|
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
|
||||||
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
|
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
|
||||||
@ -41,7 +41,7 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
protected List<ReactPackage> getPackages() {
|
protected List<ReactPackage> getPackages() {
|
||||||
return Arrays.<ReactPackage>asList(
|
return Arrays.<ReactPackage>asList(
|
||||||
new MainReactPackage(),
|
new MainReactPackage(),
|
||||||
new ReactNativeRestartPackage(),
|
new RNBridgePackage(),
|
||||||
new RNFirebasePackage(),
|
new RNFirebasePackage(),
|
||||||
new RNFirebaseAdMobPackage(),
|
new RNFirebaseAdMobPackage(),
|
||||||
new RNFirebaseAnalyticsPackage(),
|
new RNFirebaseAnalyticsPackage(),
|
||||||
@ -70,7 +70,6 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
getReactNativeHost().getReactInstanceManager().getDevSupportManager().getDevSettings().setRemoteJSDebugEnabled(true);
|
|
||||||
SoLoader.init(this, /* native exopackage */ false);
|
SoLoader.init(this, /* native exopackage */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ rootProject.name = 'RNFTests'
|
|||||||
include ':react-native-firebase'
|
include ':react-native-firebase'
|
||||||
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, './../../android')
|
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, './../../android')
|
||||||
|
|
||||||
include ':react-native-restart'
|
include ':bridge'
|
||||||
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')
|
project(':bridge').projectDir = new File(rootProject.projectDir, '../node_modules/bridge/android')
|
||||||
|
|
||||||
include ':app'
|
include ':app'
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { AppRegistry, Text, View } from 'react-native';
|
import { AppRegistry, Text, View } from 'react-native';
|
||||||
|
|
||||||
import bridge from './bridge/env/rn';
|
import bridge from 'bridge/platform/react-native';
|
||||||
import firebase from './firebase';
|
import firebase from './firebase';
|
||||||
|
|
||||||
require('sinon');
|
require('sinon');
|
||||||
|
10
tests-new/bridge/env/node/vm.js
vendored
10
tests-new/bridge/env/node/vm.js
vendored
@ -26,9 +26,9 @@ function handleError(message) {
|
|||||||
throw new Error(message);
|
throw new Error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadUrl(url) {
|
async function downloadUrl(fileUrl) {
|
||||||
const res = await new Promise((resolve, reject) =>
|
const res = await new Promise((resolve, reject) =>
|
||||||
http.get(url, resolve).on('error', reject)
|
http.get(fileUrl, resolve).on('error', reject)
|
||||||
);
|
);
|
||||||
|
|
||||||
let buffer = '';
|
let buffer = '';
|
||||||
@ -60,11 +60,7 @@ async function downloadBundle(bundleUrl) {
|
|||||||
|
|
||||||
async function getBundle(request) {
|
async function getBundle(request) {
|
||||||
if (bundle) return bundle;
|
if (bundle) return bundle;
|
||||||
console.log(
|
console.log(`${chalk.blue('[bridge]')} debugger connected`);
|
||||||
`${chalk.blue(
|
|
||||||
'[bridge]'
|
|
||||||
)} debugger has connected! Downloading app JS bundle...`
|
|
||||||
);
|
|
||||||
|
|
||||||
const parsedUrl = url.parse(request.url, true);
|
const parsedUrl = url.parse(request.url, true);
|
||||||
invariant(parsedUrl.query);
|
invariant(parsedUrl.query);
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
--slow 2200
|
--slow 2200
|
||||||
--bail
|
--bail
|
||||||
--exit
|
--exit
|
||||||
--require ./bridge/env/node
|
--require bridge/platform/node
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
"mocha": "^4.0.1",
|
"mocha": "^4.0.1",
|
||||||
"react": "^16.2.0",
|
"react": "^16.2.0",
|
||||||
"react-native": "^0.52.3",
|
"react-native": "^0.52.3",
|
||||||
"react-native-restart": "0.0.6",
|
|
||||||
"should": "^13.2.1",
|
"should": "^13.2.1",
|
||||||
"should-sinon": "0.0.6",
|
"should-sinon": "0.0.6",
|
||||||
"sinon": "^4.4.8",
|
"sinon": "^4.4.8",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user