diff --git a/test/test.ts b/test/test.ts index abd75ee..ab1cf79 100644 --- a/test/test.ts +++ b/test/test.ts @@ -4,13 +4,15 @@ import * as smartfile from '@pushrocks/smartfile'; import * as smartpromise from '@pushrocks/smartpromise'; import * as smartrx from '@pushrocks/smartrx'; +import * as fs from 'fs'; + // the module to test if (process.env.CI) { process.exit(0); } let testSmartchok: smartchok.Smartchok; -let testAddObservable: smartrx.rxjs.Observable; +let testAddObservable: smartrx.rxjs.Observable<[string, fs.Stats]>; let testSubscription: smartrx.rxjs.Subscription; tap.test('should create a new instance', async () => { 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 () => { let testDeferred = smartpromise.defer(); - testSubscription = testAddObservable.subscribe((x) => { + testSubscription = testAddObservable.subscribe(pathArg => { + const pathResult = pathArg[0]; + console.log(pathResult); testDeferred.resolve(); }); smartfile.memory.toFs('HI', './test/assets/hi.txt'); diff --git a/ts/smartchok.classes.smartchok.ts b/ts/smartchok.classes.smartchok.ts index 28d2608..312b8cd 100644 --- a/ts/smartchok.classes.smartchok.ts +++ b/ts/smartchok.classes.smartchok.ts @@ -49,7 +49,7 @@ export class Smartchok { /** * gets an observable for a certain event */ - public getObservableFor(fsEvent: TFsEvent): Promise> { + public getObservableFor(fsEvent: TFsEvent): Promise> { const done = plugins.smartpromise.defer>(); this.watchingDeferred.promise.then(() => { const eventObservable = this.eventObservablemap.getObservableForEmitterEvent( diff --git a/ts/smartchok.plugins.ts b/ts/smartchok.plugins.ts index b8f9209..4b66575 100644 --- a/ts/smartchok.plugins.ts +++ b/ts/smartchok.plugins.ts @@ -1,7 +1,9 @@ // node native +import * as fs from 'fs'; import * as path from 'path'; export { + fs, path }