Skip to content

Commit

Permalink
Fixing React Native tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Nov 17, 2020
1 parent 1729f80 commit f10977a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
11 changes: 6 additions & 5 deletions misc/ReactNativeTestApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ import {
} from 'react-native/Libraries/NewAppScreen';



// Inject the crpyot shims (BEFORE the ethers shims)
import "./crypto-shims.js";
// Inject the crypto shims (BEFORE the ethers shims)
import "react-native-get-random-values";

// Inject the missing features with the ethers shims
import "./libs/shims.js";
//import "@ethersproject/shims";
import "./libs/shims";

// Import ethers
import { ethers } from "./libs/ethers.js";
//import { ethers } from "ethers";
import { ethers } from "./libs/ethers";

// Import the test framework
import "./libs/mocha.js";
Expand Down
3 changes: 0 additions & 3 deletions misc/ReactNativeTestApp/crypto-shims.js

This file was deleted.

12 changes: 6 additions & 6 deletions misc/ReactNativeTestApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ PODS:
- boost-for-react-native
- DoubleConversion
- glog
- get-random-values-polypony (1.0.0):
- React
- glog (0.3.5)
- OpenSSL-Universal (1.0.2.19):
- OpenSSL-Universal/Static (= 1.0.2.19)
Expand Down Expand Up @@ -238,6 +236,8 @@ PODS:
- React-cxxreact (= 0.63.2)
- React-jsi (= 0.63.2)
- React-jsinspector (0.63.2)
- react-native-get-random-values (1.5.0):
- React
- React-RCTActionSheet (0.63.2):
- React-Core/RCTActionSheetHeaders (= 0.63.2)
- React-RCTAnimation (0.63.2):
Expand Down Expand Up @@ -326,7 +326,6 @@ DEPENDENCIES:
- FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1)
- FlipperKit/SKIOSNetworkPlugin (~> 0.41.1)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- get-random-values-polypony (from `../node_modules/get-random-values-polypony`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
Expand All @@ -340,6 +339,7 @@ DEPENDENCIES:
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
Expand Down Expand Up @@ -376,8 +376,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
get-random-values-polypony:
:path: "../node_modules/get-random-values-polypony"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
RCTRequired:
Expand All @@ -400,6 +398,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
react-native-get-random-values:
:path: "../node_modules/react-native-get-random-values"
React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
Expand Down Expand Up @@ -438,7 +438,6 @@ SPEC CHECKSUMS:
Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7
FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
get-random-values-polypony: 6caa66e41322297b72477ffe91201a06890fcf8a
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe
Expand All @@ -451,6 +450,7 @@ SPEC CHECKSUMS:
React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
react-native-get-random-values: 1404bd5cc0ab0e287f75ee1c489555688fc65f89
React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13
Expand Down
18 changes: 13 additions & 5 deletions misc/ReactNativeTestApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions misc/ReactNativeTestApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"lint": "eslint ."
},
"dependencies": {
"get-random-values-polypony": "^1.0.0",
"react": "16.13.1",
"react-native": "0.63.2"
"react-native": "0.63.2",
"react-native-get-random-values": "1.5.0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
Expand Down
2 changes: 1 addition & 1 deletion misc/ReactNativeTestApp/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

cp ../../packages/ethers/dist/ethers-all.umd.min.js libs/ethers.js
cp ../../packages/ethers/dist/ethers.umd.min.js libs/ethers.js
cp ../../node_modules/mocha/mocha.js libs/mocha.js
cp ../../packages/tests/dist/tests.umd.js libs/tests.js
cp ../../packages/shims/dist/index.js libs/shims.js
Expand Down

0 comments on commit f10977a

Please sign in to comment.