fix browser tests
This commit is contained in:
parent
a0a730b3d8
commit
f1d7662a70
|
@ -24,6 +24,7 @@ var modules = [
|
||||||
'lib/ECIES',
|
'lib/ECIES',
|
||||||
'lib/Electrum',
|
'lib/Electrum',
|
||||||
'lib/Message',
|
'lib/Message',
|
||||||
|
'lib/NetworkMonitor',
|
||||||
'lib/Opcode',
|
'lib/Opcode',
|
||||||
'lib/PayPro',
|
'lib/PayPro',
|
||||||
'lib/Peer',
|
'lib/Peer',
|
||||||
|
@ -101,6 +102,9 @@ var createBitcore = function(opts) {
|
||||||
b.require(opts.dir + 'bufferput', {
|
b.require(opts.dir + 'bufferput', {
|
||||||
expose: 'bufferput'
|
expose: 'bufferput'
|
||||||
});
|
});
|
||||||
|
b.require(opts.dir + 'events', {
|
||||||
|
expose: 'events'
|
||||||
|
});
|
||||||
b.require(opts.dir + 'buffers', {
|
b.require(opts.dir + 'buffers', {
|
||||||
expose: 'buffers'
|
expose: 'buffers'
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,6 +18,7 @@ var doubleSha256 = util.twoSha256;
|
||||||
var SecureRandom = require('./SecureRandom');
|
var SecureRandom = require('./SecureRandom');
|
||||||
var nonce = SecureRandom.getPseudoRandomBuffer(8);
|
var nonce = SecureRandom.getPseudoRandomBuffer(8);
|
||||||
var nodeUtil = require('util');
|
var nodeUtil = require('util');
|
||||||
|
var EventEmitter = require('events').EventEmitter;
|
||||||
|
|
||||||
var BIP0031_VERSION = 60000;
|
var BIP0031_VERSION = 60000;
|
||||||
|
|
||||||
|
@ -59,7 +60,6 @@ function Connection(socket, peer, opts) {
|
||||||
|
|
||||||
this.setupHandlers();
|
this.setupHandlers();
|
||||||
}
|
}
|
||||||
var EventEmitter = require('events').EventEmitter;
|
|
||||||
nodeUtil.inherits(Connection, EventEmitter);
|
nodeUtil.inherits(Connection, EventEmitter);
|
||||||
Connection.prototype.open = function(callback) {
|
Connection.prototype.open = function(callback) {
|
||||||
if (typeof callback === 'function') this.once('connect', callback);
|
if (typeof callback === 'function') this.once('connect', callback);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<div id="mocha"></div>
|
<div id="mocha"></div>
|
||||||
<script src="../node_modules/mocha/mocha.js"></script>
|
<script src="../node_modules/mocha/mocha.js"></script>
|
||||||
<script src="../node_modules/chai/chai.js"></script>
|
<script src="../node_modules/chai/chai.js"></script>
|
||||||
|
<script src="../node_modules/sinon/pkg/sinon.js"></script>
|
||||||
<script>mocha.setup('bdd')</script>
|
<script>mocha.setup('bdd')</script>
|
||||||
<script src="../browser/bundle.js"></script>
|
<script src="../browser/bundle.js"></script>
|
||||||
<script src="../browser/testdata.js"></script>
|
<script src="../browser/testdata.js"></script>
|
||||||
|
@ -31,6 +32,7 @@
|
||||||
<script src="test.main.js"></script>
|
<script src="test.main.js"></script>
|
||||||
<script src="test.Message.js"></script>
|
<script src="test.Message.js"></script>
|
||||||
<script src="test.misc.js"></script>
|
<script src="test.misc.js"></script>
|
||||||
|
<script src="test.NetworkMonitor.js"></script>
|
||||||
<script src="test.Opcode.js"></script>
|
<script src="test.Opcode.js"></script>
|
||||||
<script src="test.PayPro.js"></script>
|
<script src="test.PayPro.js"></script>
|
||||||
<script src="test.Peer.js"></script>
|
<script src="test.Peer.js"></script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var chai = chai || require('chai');
|
var chai = chai || require('chai');
|
||||||
var sinon = require('sinon');
|
var sinon = sinon || require('sinon');
|
||||||
var bitcore = bitcore || require('../bitcore');
|
var bitcore = bitcore || require('../bitcore');
|
||||||
var Transaction = bitcore.Transaction;
|
var Transaction = bitcore.Transaction;
|
||||||
var NetworkMonitor = bitcore.NetworkMonitor;
|
var NetworkMonitor = bitcore.NetworkMonitor;
|
||||||
|
@ -36,6 +36,7 @@ describe('NetworkMonitor', function() {
|
||||||
it('should be able to start instance', function() {
|
it('should be able to start instance', function() {
|
||||||
var nm = new NetworkMonitor.create(config);
|
var nm = new NetworkMonitor.create(config);
|
||||||
nm.start.bind(nm).should.not.throw();
|
nm.start.bind(nm).should.not.throw();
|
||||||
|
nm.stop();
|
||||||
});
|
});
|
||||||
it('should be able to stop instance', function() {
|
it('should be able to stop instance', function() {
|
||||||
var nm = new NetworkMonitor.create(config);
|
var nm = new NetworkMonitor.create(config);
|
||||||
|
|
Loading…
Reference in New Issue