Classify Http & Ws providers (#120)

* Class-ify HttpProvider

* Class-ify WsProvider (tests still WIP)

* Rework tests

* rx-api usage
This commit is contained in:
Jaco Greeff
2018-08-07 16:59:40 +02:00
committed by GitHub
parent f74fd9e01d
commit fe4c34defe
38 changed files with 342 additions and 531 deletions
+14 -2
View File
@@ -4,13 +4,25 @@
import { TEST_HTTP_URL } from '../../test/mockHttp';
import createHttp from './index';
import Http from './index';
describe('Http', () => {
let http;
beforeEach(() => {
http = createHttp(TEST_HTTP_URL);
http = new Http(TEST_HTTP_URL);
});
it('requires an http:// prefixed endpoint', () => {
expect(
() => new Http('ws://')
).toThrow(/with 'http/);
});
it('allows https:// endpoints', () => {
expect(
() => new Http('https://')
).not.toThrow();
});
it('always returns isConnected true', () => {