Move Rx API wrapper into api (#87)

* Move Rx API wrapper into api

* Bump
This commit is contained in:
Jaco Greeff
2018-05-07 12:01:09 +02:00
committed by GitHub
parent 2c6a853f73
commit 92c7c2cc1f
25 changed files with 545 additions and 12 deletions
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
jest.mock('./observable', () => (subName, name, section) => `${subName}_${name}_${Object.keys(section).join(':')}`);
const createInterface = require('./interface');
describe('createInterface', () => {
let api;
let int;
beforeEach(() => {
api = {
chain: {
foo: 'test',
bar: 'test',
subscribe: 'noInclude',
unsubscribe: 'noInclude'
},
state: {
baz: 'test'
}
};
int = createInterface(api, 'chain');
});
it('creates observables for all relevant methods', () => {
expect(
int
).toEqual({
foo: 'chain_foo_foo_foo:bar:subscribe:unsubscribe',
bar: 'chain_bar_bar_foo:bar:subscribe:unsubscribe'
});
});
});