UNPKG

leap-node

Version:

[![codecov](https://codecov.io/gh/leapdao/leap-node/branch/master/graph/badge.svg)](https://codecov.io/gh/leapdao/leap-node) [![Docker Repository on Quay](https://quay.io/repository/leapdao/leap-node/status "Docker Repository on Quay")](https://quay.io/re

35 lines (28 loc) 772 B
const methods = require('./index'); describe('api/methods', () => { test('#net_version', async () => { const bridgeState = { networkId: 55881, }; const { nodeApi } = methods(bridgeState); expect(await nodeApi.net_version()).toEqual(55881); }); test('#plasma_getState', async () => { const bridgeState = { networkId: 55881, currentState: { epoch: { epochLength: 5, }, }, something: { nested: 'thing', }, }; const { nodeApi } = methods(bridgeState); const state = await nodeApi.plasma_getState(); expect(state.networkId).toEqual(55881); expect(state.currentState.epoch.epochLength).toEqual(5); expect(state.something).toEqual(undefined); }); });