2023-07-12 08:57:25 +00:00
|
|
|
import { tap, expect } from '@push.rocks/tapbundle';
|
2017-11-01 13:59:28 +00:00
|
|
|
|
2022-08-05 10:50:37 +00:00
|
|
|
import * as smartrx from '../ts/index.js';
|
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();
|
2022-01-24 02:44:13 +00:00
|
|
|
expect(testObservableIntake).toBeInstanceOf(smartrx.ObservableIntake);
|
2018-10-10 14:44:44 +00:00
|
|
|
});
|
2017-11-01 13:59:28 +00:00
|
|
|
|
2020-07-12 01:53:32 +00:00
|
|
|
tap.test('expect testObserservableIntake to push things', async (tools) => {
|
2018-10-10 14:44:44 +00:00
|
|
|
const testObserservableIntake = new smartrx.ObservableIntake();
|
2022-01-24 02:44:13 +00:00
|
|
|
testObserservableIntake.subscribe((value: any) => {
|
2018-10-10 14:44:44 +00:00
|
|
|
console.log(value);
|
|
|
|
});
|
|
|
|
|
|
|
|
testObserservableIntake.push('hi');
|
|
|
|
testObserservableIntake.push('wow');
|
|
|
|
testObserservableIntake.signalComplete();
|
|
|
|
await testObserservableIntake.completed;
|
|
|
|
});
|
|
|
|
|
2020-07-12 01:53:32 +00:00
|
|
|
tap.test('expect testObserservableIntake to push things', async (tools) => {
|
2018-10-10 14:44:44 +00:00
|
|
|
const testObserservableIntake = new smartrx.ObservableIntake();
|
|
|
|
testObserservableIntake.push('hi');
|
|
|
|
testObserservableIntake.push('wow');
|
|
|
|
testObserservableIntake.makeBuffered();
|
|
|
|
testObserservableIntake.push('jo');
|
2022-01-24 02:44:13 +00:00
|
|
|
testObserservableIntake.subscribe((value: any) => {
|
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();
|