* Auto-conversion * ES6 import/export * WIP... * WIP... * And... we are TS typed, some good, some bad, some better, some worse * Tests passing
23 lines
643 B
JavaScript
23 lines
643 B
JavaScript
// Copyright 2017-2018 @polkadot/api-rx authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the ISC license. See the LICENSE file for details.
|
|
|
|
jest.mock('@polkadot/api-provider/ws', () => () => ({
|
|
isConnected: () => true,
|
|
on: () => true,
|
|
send: () => true
|
|
}));
|
|
jest.mock('./interface', () => (api, sectionName) => sectionName);
|
|
|
|
const createApi = require('./index').default;
|
|
|
|
describe('createApi', () => {
|
|
it('creates an instance with all sections', () => {
|
|
expect(
|
|
Object.keys(createApi())
|
|
).toEqual([
|
|
'isConnected', 'author', 'chain', 'state', 'system'
|
|
]);
|
|
});
|
|
});
|