UNPKG

bitcore-node

Version:

A blockchain indexing node with extended capabilities using bitcore

40 lines 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const chai_1 = require("chai"); const config_1 = require("../../../src/services/config"); const unit_1 = require("../../helpers/unit"); describe('Config', function () { before(unit_1.unitBeforeHelper); after(unit_1.unitAfterHelper); it('should have a test which runs', function () { (0, chai_1.expect)(true).to.equal(true); }); it('should give the chain config', () => { const chains = config_1.Config.chains(); for (const chain of chains) { const networks = config_1.Config.networksFor(chain); for (const network of networks) { const chainConfig = config_1.Config.chainConfig({ chain, network }); (0, chai_1.expect)(chainConfig).to.exist; } } }); it('should be able to update config', () => { const originalConfig = config_1.Config.get(); const chain = 'BTC'; const network = 'testnet'; const testConfig = { [chain]: { [network]: { title: 'test' } } }; config_1.Config.updateConfig({ chains: testConfig }); const testnetConfig = config_1.Config.chainConfig({ chain, network }); (0, chai_1.expect)(testnetConfig.title).to.exist; (0, chai_1.expect)(testnetConfig).to.deep.eq(testConfig[chain][network]); config_1.Config.updateConfig(originalConfig); }); }); //# sourceMappingURL=config.spec.js.map