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

25 lines (19 loc) 651 B
/* eslint-disable camelcase */ const getNodeStatus = require('./getNodeStatus'); const fakeApp = sync_info => ({ status: async () => ({ sync_info }), }); describe('getNodeStatus', () => { test('catching-up', async () => { const status = await getNodeStatus({}, fakeApp({ catching_up: true })); expect(status).toBe('catching-up'); }); test('waiting-for-period', async () => { const status = await getNodeStatus({ checkCallsCount: 1 }, fakeApp({})); expect(status).toBe('waiting-for-period'); }); test('ok', async () => { const status = await getNodeStatus({}, fakeApp({})); expect(status).toBe('ok'); }); });