mirror of https://github.com/BTCPrivate/copay.git
make WebRTC tests work
This commit is contained in:
parent
434dad831d
commit
8bba982978
|
@ -1,3 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
var imports = require('soop').imports();
|
||||
var EventEmitter= imports.EventEmitter || require('events').EventEmitter;
|
||||
|
|
|
@ -5,34 +5,41 @@ var should = chai.should();
|
|||
var expect = chai.expect;
|
||||
var sinon = sinon || require('sinon');
|
||||
var bitcore = bitcore || require('bitcore');
|
||||
var copay = copay || require('../copay');
|
||||
var Network = copay.WebRTC || require('../js/models/network/WebRTC.js');
|
||||
try {
|
||||
var copay = require('copay'); //browser
|
||||
} catch (e) {
|
||||
var copay = require('../copay'); //node
|
||||
}
|
||||
var WebRTC = require('../js/models/network/WebRTC');
|
||||
|
||||
describe('Network / WebRTC', function() {
|
||||
|
||||
it('should create an instance', function () {
|
||||
var n = new Network();
|
||||
var n = new WebRTC();
|
||||
should.exist(n);
|
||||
});
|
||||
|
||||
/*
|
||||
describe('#Network constructor', function() {
|
||||
describe('#WebRTC constructor', function() {
|
||||
it('should set reconnect attempts', function() {
|
||||
var n = new WebRTC();
|
||||
n.reconnectAttempts.should.equal(3);
|
||||
});
|
||||
|
||||
it('should call cleanUp', function() {
|
||||
var save = Network.prototype.cleanUp;
|
||||
Network.prototype.cleanUp = sinon.spy();
|
||||
var n = new Network();
|
||||
var save = WebRTC.prototype.cleanUp;
|
||||
WebRTC.prototype.cleanUp = sinon.spy();
|
||||
var n = new WebRTC();
|
||||
n.cleanUp.calledOnce.should.equal(true);
|
||||
Network.prototype.cleanUp = save;
|
||||
WebRTC.prototype.cleanUp = save;
|
||||
});
|
||||
});
|
||||
|
||||
describe('#cleanUp', function() {
|
||||
it('should set privkey to null', function() {
|
||||
var n = new Network();
|
||||
var n = new WebRTC();
|
||||
n.cleanUp();
|
||||
expect(n.privkey).to.equal(null);
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue