aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-07-26 05:36:19 +0800
committerkumavis <aaron@kumavis.me>2017-07-26 05:36:19 +0800
commit4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a (patch)
tree8a0ea01da5ea2f9c970129bb8b7b3483f56b11fc /test
parent5b9a6bd367173330d8bcfd973278eeba6f31ec06 (diff)
downloadtangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.tar
tangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.tar.gz
tangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.tar.bz2
tangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.tar.lz
tangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.tar.xz
tangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.tar.zst
tangerine-wallet-browser-4445ba15694fc6ef7f9c4e3a2de5de5428e28b3a.zip
tx cont - add argument for provider constructor
Diffstat (limited to 'test')
-rw-r--r--test/unit/network-contoller-test.js36
1 files changed, 21 insertions, 15 deletions
diff --git a/test/unit/network-contoller-test.js b/test/unit/network-contoller-test.js
index 0c7ee9d70..87c2ee7a3 100644
--- a/test/unit/network-contoller-test.js
+++ b/test/unit/network-contoller-test.js
@@ -3,6 +3,9 @@ const NetworkController = require('../../app/scripts/controllers/network')
describe('# Network Controller', function () {
let networkController
+ const networkControllerProviderInit = {
+ getAccounts: () => {},
+ }
beforeEach(function () {
networkController = new NetworkController({
@@ -10,26 +13,13 @@ describe('# Network Controller', function () {
type: 'rinkeby',
},
})
- // stub out provider
- networkController._provider = new Proxy({}, {
- get: (obj, name) => {
- return () => {}
- },
- })
- networkController.providerInit = {
- getAccounts: () => {},
- }
- networkController.ethQuery = new Proxy({}, {
- get: (obj, name) => {
- return () => {}
- },
- })
+ networkController.initializeProvider(networkControllerProviderInit, dummyProviderConstructor)
})
describe('network', function () {
describe('#provider', function () {
it('provider should be updatable without reassignment', function () {
- networkController.initializeProvider(networkController.providerInit)
+ networkController.initializeProvider(networkControllerProviderInit, dummyProviderConstructor)
const provider = networkController.provider
networkController._provider = {test: true}
assert.ok(provider.test)
@@ -75,3 +65,19 @@ describe('# Network Controller', function () {
})
})
})
+
+function dummyProviderConstructor() {
+ return {
+ // provider
+ sendAsync: noop,
+ // block tracker
+ start: noop,
+ stop: noop,
+ on: noop,
+ addListener: noop,
+ once: noop,
+ removeAllListeners: noop,
+ }
+}
+
+function noop() {} \ No newline at end of file