fixing tests

This commit is contained in:
Matias Alejo Garcia 2014-06-09 11:33:57 -03:00
parent 521dd3efe5
commit abcbda8cf4
1 changed files with 16 additions and 3 deletions

View File

@ -237,14 +237,27 @@ describe('Wallet model', function() {
throw ();
});
it('call reconnect after interval', function(done) {
it.only('call reconnect after interval', function(done) {
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');
w.netStart();
setTimeout(function() {
sinon.assert.callCount(spy, 10);
sinon.assert.callCount(spy, callCount);
done();
}, 1000);
}, testTime);
});
it('handle network indexes correctly', function() {