Fixing React Native tests.

This commit is contained in:
Richard Moore 2020-11-17 13:41:43 -05:00
parent 1729f804fb
commit f10977ab35
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
6 changed files with 28 additions and 22 deletions

@ -21,15 +21,16 @@ import {
} from 'react-native/Libraries/NewAppScreen'; } from 'react-native/Libraries/NewAppScreen';
// Inject the crypto shims (BEFORE the ethers shims)
// Inject the crpyot shims (BEFORE the ethers shims) import "react-native-get-random-values";
import "./crypto-shims.js";
// Inject the missing features with the ethers shims // Inject the missing features with the ethers shims
import "./libs/shims.js"; //import "@ethersproject/shims";
import "./libs/shims";
// Import ethers // Import ethers
import { ethers } from "./libs/ethers.js"; //import { ethers } from "ethers";
import { ethers } from "./libs/ethers";
// Import the test framework // Import the test framework
import "./libs/mocha.js"; import "./libs/mocha.js";

@ -1,3 +0,0 @@
try {
require("get-random-values-polypony").polyfill();
} catch (error) { };

@ -66,8 +66,6 @@ PODS:
- boost-for-react-native - boost-for-react-native
- DoubleConversion - DoubleConversion
- glog - glog
- get-random-values-polypony (1.0.0):
- React
- glog (0.3.5) - glog (0.3.5)
- OpenSSL-Universal (1.0.2.19): - OpenSSL-Universal (1.0.2.19):
- OpenSSL-Universal/Static (= 1.0.2.19) - OpenSSL-Universal/Static (= 1.0.2.19)
@ -238,6 +236,8 @@ PODS:
- React-cxxreact (= 0.63.2) - React-cxxreact (= 0.63.2)
- React-jsi (= 0.63.2) - React-jsi (= 0.63.2)
- React-jsinspector (0.63.2) - React-jsinspector (0.63.2)
- react-native-get-random-values (1.5.0):
- React
- React-RCTActionSheet (0.63.2): - React-RCTActionSheet (0.63.2):
- React-Core/RCTActionSheetHeaders (= 0.63.2) - React-Core/RCTActionSheetHeaders (= 0.63.2)
- React-RCTAnimation (0.63.2): - React-RCTAnimation (0.63.2):
@ -326,7 +326,6 @@ DEPENDENCIES:
- FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1) - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1)
- FlipperKit/SKIOSNetworkPlugin (~> 0.41.1) - FlipperKit/SKIOSNetworkPlugin (~> 0.41.1)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) - 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`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
@ -340,6 +339,7 @@ DEPENDENCIES:
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - 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-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
@ -376,8 +376,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/FBReactNativeSpec" :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
Folly: Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
get-random-values-polypony:
:path: "../node_modules/get-random-values-polypony"
glog: glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
RCTRequired: RCTRequired:
@ -400,6 +398,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor" :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector: React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector" :path: "../node_modules/react-native/ReactCommon/jsinspector"
react-native-get-random-values:
:path: "../node_modules/react-native-get-random-values"
React-RCTActionSheet: React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS" :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation: React-RCTAnimation:
@ -438,7 +438,6 @@ SPEC CHECKSUMS:
Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7
FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83 FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83
Folly: b73c3869541e86821df3c387eb0af5f65addfab4 Folly: b73c3869541e86821df3c387eb0af5f65addfab4
get-random-values-polypony: 6caa66e41322297b72477ffe91201a06890fcf8a
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe
@ -451,6 +450,7 @@ SPEC CHECKSUMS:
React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8 React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38 React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606 React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
react-native-get-random-values: 1404bd5cc0ab0e287f75ee1c489555688fc65f89
React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5 React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6 React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13 React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13

@ -4560,6 +4560,11 @@
"time-stamp": "^1.0.0" "time-stamp": "^1.0.0"
} }
}, },
"fast-base64-decode": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz",
"integrity": "sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q=="
},
"fast-deep-equal": { "fast-deep-equal": {
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@ -4848,11 +4853,6 @@
"integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==",
"dev": true "dev": true
}, },
"get-random-values-polypony": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/get-random-values-polypony/-/get-random-values-polypony-1.0.0.tgz",
"integrity": "sha512-UtDFXSNnVWkocN5Rbe0zabJVLqlEiEPjy7yZ9PaXVeCW8WvalKyY63NKbX1uF3FlPk2Uyk8SvWcQX7fz+eeMiQ=="
},
"get-stdin": { "get-stdin": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
@ -9837,6 +9837,14 @@
} }
} }
}, },
"react-native-get-random-values": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/react-native-get-random-values/-/react-native-get-random-values-1.5.0.tgz",
"integrity": "sha512-LK+Wb8dEimJkd/dub7qziDmr9Tw4chhpzVeQ6JDo4czgfG4VXbptRyOMdu8503RiMF6y9pTH6ZUTkrrpprqT7w==",
"requires": {
"fast-base64-decode": "^1.0.0"
}
},
"react-refresh": { "react-refresh": {
"version": "0.4.3", "version": "0.4.3",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.4.3.tgz", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.4.3.tgz",

@ -10,9 +10,9 @@
"lint": "eslint ." "lint": "eslint ."
}, },
"dependencies": { "dependencies": {
"get-random-values-polypony": "^1.0.0",
"react": "16.13.1", "react": "16.13.1",
"react-native": "0.63.2" "react-native": "0.63.2",
"react-native-get-random-values": "1.5.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.8.4", "@babel/core": "^7.8.4",

@ -1,6 +1,6 @@
#!/bin/bash #!/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 ../../node_modules/mocha/mocha.js libs/mocha.js
cp ../../packages/tests/dist/tests.umd.js libs/tests.js cp ../../packages/tests/dist/tests.umd.js libs/tests.js
cp ../../packages/shims/dist/index.js libs/shims.js cp ../../packages/shims/dist/index.js libs/shims.js