mirror of https://github.com/BTCPrivate/copay.git
fixing tests
This commit is contained in:
parent
521dd3efe5
commit
abcbda8cf4
|
@ -237,14 +237,27 @@ describe('Wallet model', function() {
|
||||||
throw ();
|
throw ();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('call reconnect after interval', function(done) {
|
it.only('call reconnect after interval', function(done) {
|
||||||
var w = createW2();
|
var w = createW2();
|
||||||
|
var testTime = 1000;
|
||||||
|
var callCount = 0;
|
||||||
|
var cT=w.reconnectDelay;
|
||||||
|
console.log('[test.Wallet.js.238:cT:]',cT); //TODO
|
||||||
|
var t=0;
|
||||||
|
do {
|
||||||
|
callCount++;
|
||||||
|
t += cT;
|
||||||
|
cT *= 2;
|
||||||
|
console.log('[test.Wallet.js.242]',t, callCount); //TODO
|
||||||
|
} while (t<testTime);
|
||||||
|
console.log('[test.Wallet.js.241:callCount:]',callCount); //TODO
|
||||||
|
|
||||||
var spy = sinon.spy(w, 'scheduleConnect');
|
var spy = sinon.spy(w, 'scheduleConnect');
|
||||||
w.netStart();
|
w.netStart();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
sinon.assert.callCount(spy, 10);
|
sinon.assert.callCount(spy, callCount);
|
||||||
done();
|
done();
|
||||||
}, 1000);
|
}, testTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handle network indexes correctly', function() {
|
it('handle network indexes correctly', function() {
|
||||||
|
|
Loading…
Reference in New Issue