Files
api/packages/api-derive/test/e2e/derive.spec.ts
T
Amaury Martiny f6c93e48b7 Add derive functions (#540)
* Make types work

* Add test for derive

* Skip e2e

* Change description

* Add some comments

* Add caching

* Integrate cache

* Add tests

* Add test

* Fix types in tests

* Add e2e tests

* Add comments

* Fix lint

* Bump versions

* Remove useless stuff

* Address grumbles
2019-01-09 10:59:56 +01:00

39 lines
1.0 KiB
TypeScript

// Copyright 2017-2018 @polkadot/api-derive 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 BN from 'bn.js';
import ApiRx from '@polkadot/api/rx';
import { BlockNumber } from '@polkadot/types/index';
describe.skip('derive e2e', () => {
let api: ApiRx;
beforeAll(() => {
jest.setTimeout(30000);
});
beforeEach(async () => {
api = await ApiRx.create().toPromise();
});
it('derive.chain.bestNumber', async (done) => {
api.derive.chain.bestNumber().subscribe((blockNumber: BlockNumber) => {
expect(blockNumber instanceof BlockNumber).toBe(true);
expect(blockNumber.gten(0)).toBe(true);
done();
});
});
it('derive.session.sessionProgress', async (done) => {
api.derive.session.sessionProgress().subscribe((progress: BN) => {
expect(progress instanceof BN).toBe(true);
done();
});
});
afterAll(() => {
jest.setTimeout(5000);
});
});