refactor test
This commit is contained in:
parent
1a68ca4fae
commit
6e600b5def
@ -2434,9 +2434,8 @@ describe('Address Service', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe.only('#_updateAddressIndex', function() {
|
describe('#_updateAddressIndex', function() {
|
||||||
var as;
|
it('should add using 2 keys', function() {
|
||||||
beforeEach(function(){
|
|
||||||
var testnode = {
|
var testnode = {
|
||||||
services: {
|
services: {
|
||||||
bitcoind: {
|
bitcoind: {
|
||||||
@ -2445,12 +2444,11 @@ describe('Address Service', function() {
|
|||||||
},
|
},
|
||||||
datadir: 'testdir'
|
datadir: 'testdir'
|
||||||
};
|
};
|
||||||
as = new AddressService({
|
var as = new AddressService({
|
||||||
mempoolMemoryIndex: true,
|
mempoolMemoryIndex: true,
|
||||||
node: testnode
|
node: testnode
|
||||||
});
|
});
|
||||||
});
|
|
||||||
it('should add using 2 keys', function() {
|
|
||||||
_.values(as.mempoolAddressIndex).should.deep.equal([]);
|
_.values(as.mempoolAddressIndex).should.deep.equal([]);
|
||||||
as._updateAddressIndex('index1', true);
|
as._updateAddressIndex('index1', true);
|
||||||
as._updateAddressIndex('index1', true);
|
as._updateAddressIndex('index1', true);
|
||||||
@ -2463,7 +2461,20 @@ describe('Address Service', function() {
|
|||||||
"index2": 2
|
"index2": 2
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add/remove using 2 keys', function() {
|
it('should add/remove using 2 keys', function() {
|
||||||
|
var testnode = {
|
||||||
|
services: {
|
||||||
|
bitcoind: {
|
||||||
|
on: sinon.stub()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
datadir: 'testdir'
|
||||||
|
};
|
||||||
|
var as = new AddressService({
|
||||||
|
mempoolMemoryIndex: true,
|
||||||
|
node: testnode
|
||||||
|
});
|
||||||
_.values(as.mempoolAddressIndex).should.deep.equal([]);
|
_.values(as.mempoolAddressIndex).should.deep.equal([]);
|
||||||
as._updateAddressIndex('index1', true);
|
as._updateAddressIndex('index1', true);
|
||||||
as._updateAddressIndex('index1', true);
|
as._updateAddressIndex('index1', true);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user