Files
api/packages/rpc-rx/src/index.spec.js
T
Jaco Greeff 6678d7255c Remove api-observable (#530)
* 2019

* Remove api-observable

* tuples (SomeLonelyType) -> SomeLonelyType

* Bump to 0.37.0
2019-01-04 16:18:44 +01:00

40 lines
841 B
JavaScript

// Copyright 2017-2019 @polkadot/rpc-rx authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { isFunction } from '@polkadot/util';
jest.mock('@polkadot/rpc-provider/ws', () => class {
isConnected = () => true;
on = () => true;
send = () => true;
});
const RpcRx = require('./index').default;
describe('RpcRx', () => {
let api;
beforeEach(() => {
api = new RpcRx();
});
it('creates an instance with all sections', () => {
expect(
Object
.keys(api)
.filter((key) =>
!key.startsWith('_')
)
).toEqual([
'author', 'chain', 'state', 'system'
]);
});
it('has isConnected', () => {
expect(
isFunction(api.isConnected)
).toBe(true);
});
});