fix(core): update

This commit is contained in:
Philipp Kunz 2021-12-01 02:04:21 +01:00
parent 12ae27b2ff
commit 268201727c
3 changed files with 9 additions and 3 deletions

View File

@ -4,13 +4,15 @@ import * as smartfile from '@pushrocks/smartfile';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrx from '@pushrocks/smartrx'; import * as smartrx from '@pushrocks/smartrx';
import * as fs from 'fs';
// the module to test // the module to test
if (process.env.CI) { if (process.env.CI) {
process.exit(0); process.exit(0);
} }
let testSmartchok: smartchok.Smartchok; let testSmartchok: smartchok.Smartchok;
let testAddObservable: smartrx.rxjs.Observable<any>; let testAddObservable: smartrx.rxjs.Observable<[string, fs.Stats]>;
let testSubscription: smartrx.rxjs.Subscription; let testSubscription: smartrx.rxjs.Subscription;
tap.test('should create a new instance', async () => { tap.test('should create a new instance', async () => {
testSmartchok = new smartchok.Smartchok([]); testSmartchok = new smartchok.Smartchok([]);
@ -31,7 +33,9 @@ tap.test('should get an observable for a certain event', async () => {
tap.test('should register an add operation', async () => { tap.test('should register an add operation', async () => {
let testDeferred = smartpromise.defer(); let testDeferred = smartpromise.defer();
testSubscription = testAddObservable.subscribe((x) => { testSubscription = testAddObservable.subscribe(pathArg => {
const pathResult = pathArg[0];
console.log(pathResult);
testDeferred.resolve(); testDeferred.resolve();
}); });
smartfile.memory.toFs('HI', './test/assets/hi.txt'); smartfile.memory.toFs('HI', './test/assets/hi.txt');

View File

@ -49,7 +49,7 @@ export class Smartchok {
/** /**
* gets an observable for a certain event * gets an observable for a certain event
*/ */
public getObservableFor(fsEvent: TFsEvent): Promise<plugins.smartrx.rxjs.Observable<any>> { public getObservableFor(fsEvent: TFsEvent): Promise<plugins.smartrx.rxjs.Observable<[string, plugins.fs.Stats]>> {
const done = plugins.smartpromise.defer<plugins.smartrx.rxjs.Observable<any>>(); const done = plugins.smartpromise.defer<plugins.smartrx.rxjs.Observable<any>>();
this.watchingDeferred.promise.then(() => { this.watchingDeferred.promise.then(() => {
const eventObservable = this.eventObservablemap.getObservableForEmitterEvent( const eventObservable = this.eventObservablemap.getObservableForEmitterEvent(

View File

@ -1,7 +1,9 @@
// node native // node native
import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
export { export {
fs,
path path
} }