This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathipcprovider.js
More file actions
53 lines (47 loc) · 1.61 KB
/
ipcprovider.js
File metadata and controls
53 lines (47 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var chai = require('chai');
var assert = chai.assert;
var SandboxedModule = require('sandboxed-module');
var FakeIpcRequest = require('./helpers/FakeIpcRequest')
var net = new FakeIpcRequest();
SandboxedModule.registerBuiltInSourceTransformer('istanbul');
var IpcProvider = SandboxedModule.require('../packages/web3-providers-ipc', {
requires: {
'bn.js': require('bn.js'),
},
singleOnly: true
});
describe('web3-providers-ipc', function () {
// oboe.js DOESNT WORK with FakeIpcProvider
// describe('send', function () {
// it('should send basic async request', function (done) {
// var provider = new IpcProvider('', net);
// provider.send({id: 1, method: 'eth_test'}, function (err, result) {
// assert.isObject(result);
// done();
// });
// });
// });
// describe('isConnected', function () {
// it('should return a boolean', function () {
// var provider = new IpcProvider('', net);
//
// assert.isBoolean(provider.isConnected());
// });
//
// it('should return false', function () {
// var provider = new IpcProvider('', net);
//
// provider.connection.writable = false;
//
// assert.isFalse(provider.isConnected());
// });
//
// it('should return true, when a net handle is set', function () {
// var provider = new IpcProvider('', net);
//
// provider.connection.writable = true;
//
// assert.isTrue(provider.isConnected());
// });
// });
});