add HDParams test to moch index, get rid of unused code that caused errors

This commit is contained in:
Gregg Zigler 2014-08-19 09:06:37 -07:00
commit e16492e64b
2 changed files with 11 additions and 19 deletions

View file

@ -25,11 +25,13 @@
<script src="test.Wallet.js"></script>
<script src="test.WalletFactory.js"></script>
<script src="test.performance.js"></script>
<script src="test.HDParams.js"></script>
<script src="test.HDPath.js"></script>
<script src="test.Passphrase.js"></script>
<script src="test.TxProposal.js"></script>
<script src="test.storage.File.js"></script>
<!--
Do not try to run test.storage.File.js in browser.
It is only applicable to the node environment.
-->
<script>
mocha.run();

View file

@ -2,6 +2,7 @@
var chai = chai || require('chai');
var should = chai.should();
var bitcore = bitcore || require('bitcore');
var Address = bitcore.Address;
var buffertools = bitcore.buffertools;
@ -14,20 +15,6 @@ var PublicKeyRing = copay.PublicKeyRing;
var HDParams = copay.HDParams;
var HDPath = copay.HDPath;
var config = {
networkName: 'livenet',
};
var createAI = function() {
var i = new HDParams();
should.exist(i);
i.copayerIndex = 1;
return i;
};
describe('HDParams model', function() {
it('should create an instance (livenet)', function() {
@ -60,7 +47,8 @@ describe('HDParams model', function() {
});
it('show be able to store and read', function() {
var i = createAI();
var i = new HDParams();
i.copayerIndex = 1;
var changeN = 2;
var addressN = 2;
for (var j = 0; j < changeN; j++) {
@ -81,7 +69,8 @@ describe('HDParams model', function() {
});
it('should count generation indexes', function() {
var j = createAI();
var j = new HDParams();
j.copayerIndex = 1;
for (var i = 0; i < 3; i++)
j.increment(true);
for (var i = 0; i < 2; i++)
@ -92,7 +81,8 @@ describe('HDParams model', function() {
});
it('#merge tests', function() {
var j = createAI();
var j = new HDParams();
j.copayerIndex = 1;
for (var i = 0; i < 15; i++)
j.increment(true);
@ -116,4 +106,4 @@ describe('HDParams model', function() {
merge.should.throw(Error);
})
});
});