test: add unit test for node getNetworkName
This commit is contained in:
parent
bce64d86e3
commit
584dd2cb98
|
@ -12,9 +12,7 @@ var log = index.log;
|
|||
|
||||
describe('Bitcore Node', function() {
|
||||
|
||||
var baseConfig = {
|
||||
datadir: 'testdir'
|
||||
};
|
||||
var baseConfig = {};
|
||||
|
||||
var Node;
|
||||
|
||||
|
@ -317,6 +315,30 @@ describe('Bitcore Node', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('#getNetworkName', function() {
|
||||
afterEach(function() {
|
||||
bitcore.Networks.disableRegtest();
|
||||
});
|
||||
it('it will return the network name for livenet', function() {
|
||||
var node = new Node(baseConfig);
|
||||
node.getNetworkName().should.equal('livenet');
|
||||
});
|
||||
it('it will return the network name for testnet', function() {
|
||||
var baseConfig = {
|
||||
network: 'testnet'
|
||||
};
|
||||
var node = new Node(baseConfig);
|
||||
node.getNetworkName().should.equal('testnet');
|
||||
});
|
||||
it('it will return the network for regtest', function() {
|
||||
var baseConfig = {
|
||||
network: 'regtest'
|
||||
};
|
||||
var node = new Node(baseConfig);
|
||||
node.getNetworkName().should.equal('regtest');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#stop', function() {
|
||||
var sandbox = sinon.sandbox.create();
|
||||
beforeEach(function() {
|
||||
|
|
Loading…
Reference in New Issue