aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/network-contoller-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/network-contoller-test.js')
-rw-r--r--test/unit/network-contoller-test.js25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/unit/network-contoller-test.js b/test/unit/network-contoller-test.js
index 42ca40c56..0b3b5adeb 100644
--- a/test/unit/network-contoller-test.js
+++ b/test/unit/network-contoller-test.js
@@ -14,15 +14,15 @@ describe('# Network Controller', function () {
},
})
- networkController.initializeProvider(networkControllerProviderInit)
+ networkController.initializeProvider(networkControllerProviderInit, dummyProviderConstructor)
})
describe('network', function () {
describe('#provider', function () {
it('provider should be updatable without reassignment', function () {
- networkController.initializeProvider(networkControllerProviderInit)
- const providerProxy = networkController.providerProxy
- providerProxy.setTarget({ test: true })
- assert.ok(providerProxy.test)
+ networkController.initializeProvider(networkControllerProviderInit, dummyProviderConstructor)
+ const proxy = networkController._proxy
+ proxy.setTarget({ test: true, on: () => {} })
+ assert.ok(proxy.test)
})
})
describe('#getNetworkState', function () {
@@ -66,4 +66,19 @@ describe('# Network Controller', function () {
})
})
+function dummyProviderConstructor() {
+ return {
+ // provider
+ sendAsync: noop,
+ // block tracker
+ _blockTracker: {},
+ start: noop,
+ stop: noop,
+ on: noop,
+ addListener: noop,
+ once: noop,
+ removeAllListeners: noop,
+ }
+}
+
function noop() {} \ No newline at end of file