2
0
mirror of synced 2025-01-23 20:59:10 +00:00

[tests][bridge][android] wip switch to npm version

This commit is contained in:
Salakar 2018-03-27 23:00:18 +01:00
parent 76b4399795
commit 2537ce1276
7 changed files with 10 additions and 18 deletions

View File

@ -87,9 +87,7 @@ dependencies {
transitive = false
}
implementation(project(':react-native-restart')) {
transitive = false
}
implementation project(':bridge')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.google.android.gms:play-services-base:$firebaseVersion"

View File

@ -8,8 +8,8 @@ import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import io.invertase.bridge.RNBridgePackage;
import io.invertase.firebase.RNFirebasePackage;
import com.avishayil.rnrestart.ReactNativeRestartPackage;
import io.invertase.firebase.admob.RNFirebaseAdMobPackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
@ -41,7 +41,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReactNativeRestartPackage(),
new RNBridgePackage(),
new RNFirebasePackage(),
new RNFirebaseAdMobPackage(),
new RNFirebaseAnalyticsPackage(),
@ -70,7 +70,6 @@ public class MainApplication extends Application implements ReactApplication {
@Override
public void onCreate() {
super.onCreate();
getReactNativeHost().getReactInstanceManager().getDevSupportManager().getDevSettings().setRemoteJSDebugEnabled(true);
SoLoader.init(this, /* native exopackage */ false);
}

View File

@ -3,8 +3,8 @@ rootProject.name = 'RNFTests'
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, './../../android')
include ':react-native-restart'
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')
include ':bridge'
project(':bridge').projectDir = new File(rootProject.projectDir, '../node_modules/bridge/android')
include ':app'

View File

@ -9,7 +9,7 @@
import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
import bridge from './bridge/env/rn';
import bridge from 'bridge/platform/react-native';
import firebase from './firebase';
require('sinon');

View File

@ -26,9 +26,9 @@ function handleError(message) {
throw new Error(message);
}
async function downloadUrl(url) {
async function downloadUrl(fileUrl) {
const res = await new Promise((resolve, reject) =>
http.get(url, resolve).on('error', reject)
http.get(fileUrl, resolve).on('error', reject)
);
let buffer = '';
@ -60,11 +60,7 @@ async function downloadBundle(bundleUrl) {
async function getBundle(request) {
if (bundle) return bundle;
console.log(
`${chalk.blue(
'[bridge]'
)} debugger has connected! Downloading app JS bundle...`
);
console.log(`${chalk.blue('[bridge]')} debugger connected`);
const parsedUrl = url.parse(request.url, true);
invariant(parsedUrl.query);

View File

@ -3,4 +3,4 @@
--slow 2200
--bail
--exit
--require ./bridge/env/node
--require bridge/platform/node

View File

@ -26,7 +26,6 @@
"mocha": "^4.0.1",
"react": "^16.2.0",
"react-native": "^0.52.3",
"react-native-restart": "0.0.6",
"should": "^13.2.1",
"should-sinon": "0.0.6",
"sinon": "^4.4.8",