2018-10-10 14:44:44 +00:00
|
|
|
import { tap, expect } from '@pushrocks/tapbundle';
|
2017-11-01 13:59:28 +00:00
|
|
|
|
2018-10-10 14:44:44 +00:00
|
|
|
import * as smartrx from '../ts/index';
|
2017-11-01 13:59:28 +00:00
|
|
|
|
|
|
|
tap.test('should create a valid instance of observableinstake', async () => {
|
2018-10-10 14:44:44 +00:00
|
|
|
const testObservableIntake = new smartrx.ObservableIntake();
|
|
|
|
expect(testObservableIntake).to.be.instanceOf(smartrx.ObservableIntake);
|
|
|
|
});
|
2017-11-01 13:59:28 +00:00
|
|
|
|
2018-10-10 14:44:44 +00:00
|
|
|
tap.test('expect testObserservableIntake to push things', async tools => {
|
|
|
|
const testObserservableIntake = new smartrx.ObservableIntake();
|
2017-11-01 13:59:28 +00:00
|
|
|
testObserservableIntake.subscribe(value => {
|
2018-10-10 14:44:44 +00:00
|
|
|
console.log(value);
|
|
|
|
});
|
|
|
|
|
|
|
|
testObserservableIntake.push('hi');
|
|
|
|
testObserservableIntake.push('wow');
|
|
|
|
testObserservableIntake.signalComplete();
|
|
|
|
await testObserservableIntake.completed;
|
|
|
|
});
|
|
|
|
|
|
|
|
tap.test('expect testObserservableIntake to push things', async tools => {
|
|
|
|
const testObserservableIntake = new smartrx.ObservableIntake();
|
|
|
|
testObserservableIntake.push('hi');
|
|
|
|
testObserservableIntake.push('wow');
|
|
|
|
testObserservableIntake.makeBuffered();
|
|
|
|
testObserservableIntake.push('jo');
|
2017-11-01 16:01:30 +00:00
|
|
|
testObserservableIntake.subscribe(value => {
|
2018-10-10 14:44:44 +00:00
|
|
|
console.log(value);
|
|
|
|
testObserservableIntake.signalComplete();
|
|
|
|
});
|
|
|
|
testObserservableIntake.request(1);
|
|
|
|
await testObserservableIntake.completed;
|
|
|
|
});
|
2017-11-01 16:01:30 +00:00
|
|
|
|
2018-10-10 14:44:44 +00:00
|
|
|
tap.test('', async () => {});
|
2017-11-01 16:01:30 +00:00
|
|
|
|
2018-10-10 14:44:44 +00:00
|
|
|
tap.start();
|