E2E testing (#177)

* Move e2e tests to provider

* Rx subscriptions

* Import @polkadot/api-provider, fix package names

* Decrease verbosity, skip all e2e tests
This commit is contained in:
Jaco Greeff
2018-10-01 14:11:43 +02:00
committed by GitHub
parent d230c05d16
commit 876c34c532
11 changed files with 204 additions and 23 deletions
@@ -0,0 +1,32 @@
// 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.
import storage from '@polkadot/storage/testing';
import Ws from '@polkadot/api-provider/ws';
import RxApi from '../../src';
describe.skip('e2e subscriptions', () => {
let api;
beforeEach(() => {
jest.setTimeout(30000);
api = new RxApi(new Ws('ws://127.0.0.1:9944'));
});
it('retrieves current timestamp', (done) => {
let count = 0;
api.state
.storage([[storage.timestamp.now]])
.subscribe((data) => {
console.error('subscribe', data);
if (++count === 4) {
done();
}
});
});
});