add tests for WebRTC and fix some mocha browser test problems
from now on you need to run "grunt shell --target=dev" to build the test version of copay which you can run the mocha browser tests on, which includes packages like sinon and soop.
This commit is contained in:
parent
c78b7101db
commit
434dad831d
3 changed files with 41 additions and 2 deletions
|
|
@ -52,7 +52,6 @@
|
||||||
"mocha": "1.18.2",
|
"mocha": "1.18.2",
|
||||||
"mocha-lcov-reporter": "0.0.1",
|
"mocha-lcov-reporter": "0.0.1",
|
||||||
"node-cryptojs-aes": "0.4.0",
|
"node-cryptojs-aes": "0.4.0",
|
||||||
"sinon": "1.9.1",
|
|
||||||
"soop": "0.1.5",
|
"soop": "0.1.5",
|
||||||
"travis-cov": "0.2.5",
|
"travis-cov": "0.2.5",
|
||||||
"uglifyify": "1.2.3"
|
"uglifyify": "1.2.3"
|
||||||
|
|
@ -60,6 +59,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mocha": "^1.18.2",
|
"mocha": "^1.18.2",
|
||||||
"mocha-lcov-reporter": "0.0.1",
|
"mocha-lcov-reporter": "0.0.1",
|
||||||
"preconditions": "^1.0.7"
|
"preconditions": "^1.0.7",
|
||||||
|
"sinon": "1.9.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
<script src="../lib/bitcore/browser/bundle.js"></script>
|
<script src="../lib/bitcore/browser/bundle.js"></script>
|
||||||
<script src="../js/copayBundle.js"></script>
|
<script src="../js/copayBundle.js"></script>
|
||||||
<script src="test.blockchain.Insight.js"></script>
|
<script src="test.blockchain.Insight.js"></script>
|
||||||
|
<script src="test.network.WebRTC.js"></script>
|
||||||
<script src="test.PrivateKey.js"></script>
|
<script src="test.PrivateKey.js"></script>
|
||||||
<script src="test.PublicKeyRing.js"></script>
|
<script src="test.PublicKeyRing.js"></script>
|
||||||
<script src="test.storage.LocalEncrypted.js"></script>
|
<script src="test.storage.LocalEncrypted.js"></script>
|
||||||
|
|
|
||||||
38
test/test.network.WebRTC.js
Normal file
38
test/test.network.WebRTC.js
Normal file
|
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue