MyCrypto/spec/config/networks.spec.ts

20 lines
650 B
TypeScript
Raw Normal View History

2018-01-20 20:06:28 +00:00
import { NETWORKS, NetworkConfig } from 'config';
describe('Networks', () => {
Object.keys(NETWORKS).forEach(networkId => {
it(`${networkId} contains non-null dPathFormats`, () => {
const network: NetworkConfig = NETWORKS[networkId];
Object.values(network.dPathFormats).forEach(dPathFormat => {
expect(dPathFormat).toBeTruthy();
});
});
});
it(`contain unique chainIds`, () => {
const networkValues = Object.values(NETWORKS);
const chainIds = networkValues.map(a => a.chainId);
const chainIdsSet = new Set(chainIds);
expect(Array.from(chainIdsSet).length).toEqual(chainIds.length);
});
});