add forceNetwork parameter and test it
This commit is contained in:
parent
b3f2476992
commit
00cf32fc8d
3 changed files with 17 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ try {
|
|||
} catch (e) {
|
||||
var copay = require('../copay'); //node
|
||||
}
|
||||
var copayConfig = require('../config');
|
||||
var Wallet = require('../js/models/core/Wallet');
|
||||
var Structure = copay.Structure;
|
||||
var Storage = require('./mocks/FakeStorage');
|
||||
|
|
@ -950,4 +951,14 @@ describe('Wallet model', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('#forceNetwork in config', function() {
|
||||
it('should throw if network is different', function() {
|
||||
var backup = copayConfig.forceNetwork;
|
||||
copayConfig.forceNetwork = true;
|
||||
config.networkName = 'livenet';
|
||||
cachedCreateW2.should.throw(Error);
|
||||
copayConfig.forceNetwork = backup;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue