4 Commits

Author SHA1 Message Date
7c4324b3ad 1.0.27 2021-12-01 02:04:21 +01:00
268201727c fix(core): update 2021-12-01 02:04:21 +01:00
12ae27b2ff 1.0.26 2021-12-01 01:53:29 +01:00
3bb9b2229d fix(core): update 2021-12-01 01:53:28 +01:00
5 changed files with 12 additions and 7 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartchok",
"version": "1.0.25",
"version": "1.0.27",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartchok",
"version": "1.0.25",
"version": "1.0.27",
"license": "MIT",
"dependencies": {
"@pushrocks/lik": "^5.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartchok",
"version": "1.0.25",
"version": "1.0.27",
"private": false,
"description": "smart wrapper for chokidar",
"main": "dist_ts/index.js",
@ -24,7 +24,6 @@
"@pushrocks/lik": "^5.0.0",
"@pushrocks/smartpromise": "^3.1.6",
"@pushrocks/smartrx": "^2.0.19",
"@types/chokidar": "^2.1.3",
"chokidar": "^3.5.2"
},
"devDependencies": {

View File

@ -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<any>;
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');

View File

@ -49,7 +49,7 @@ export class Smartchok {
/**
* 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>>();
this.watchingDeferred.promise.then(() => {
const eventObservable = this.eventObservablemap.getObservableForEmitterEvent(

View File

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