diff --git a/package.json b/package.json index bec53ce4f..8fde93aa3 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "mocha": "1.18.2", "mocha-lcov-reporter": "0.0.1", "node-cryptojs-aes": "0.4.0", - "sinon": "1.9.1", "soop": "0.1.5", "travis-cov": "0.2.5", "uglifyify": "1.2.3" @@ -60,6 +59,7 @@ "dependencies": { "mocha": "^1.18.2", "mocha-lcov-reporter": "0.0.1", - "preconditions": "^1.0.7" + "preconditions": "^1.0.7", + "sinon": "1.9.1" } } diff --git a/test/index.html b/test/index.html index 4d6424d38..127df85f3 100644 --- a/test/index.html +++ b/test/index.html @@ -15,6 +15,7 @@ + diff --git a/test/test.network.WebRTC.js b/test/test.network.WebRTC.js new file mode 100644 index 000000000..28394b51c --- /dev/null +++ b/test/test.network.WebRTC.js @@ -0,0 +1,38 @@ +'use strict'; + +var chai = chai || require('chai'); +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'); + +describe('Network / WebRTC', function() { + + it('should create an instance', function () { + var n = new Network(); + should.exist(n); + }); + +/* + describe('#Network constructor', function() { + it('should call cleanUp', function() { + var save = Network.prototype.cleanUp; + Network.prototype.cleanUp = sinon.spy(); + var n = new Network(); + n.cleanUp.calledOnce.should.equal(true); + Network.prototype.cleanUp = save; + }); + }); + + describe('#cleanUp', function() { + it('should set privkey to null', function() { + var n = new Network(); + n.cleanUp(); + expect(n.privkey).to.equal(null); + }); + }); + */ + +});