Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
8cd846e8bf | |||
d98c54fba9 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartchok",
|
"name": "@push.rocks/smartchok",
|
||||||
"version": "1.0.32",
|
"version": "1.0.33",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "smart wrapper for chokidar",
|
"description": "smart wrapper for chokidar",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -20,9 +20,9 @@ tap.test('should create a new instance', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should add some files to watch and start', async () => {
|
tap.test('should add some files to watch and start', async () => {
|
||||||
testSmartchok.add(['./test/assets/**/*.txt']);
|
testSmartchok.add(['./test/**/*.txt']);
|
||||||
await testSmartchok.start()
|
await testSmartchok.start()
|
||||||
testSmartchok.add(['./test/assets/**/*.md']);
|
testSmartchok.add(['./test/**/*.md']);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should get an observable for a certain event', async () => {
|
tap.test('should get an observable for a certain event', async () => {
|
||||||
@ -42,7 +42,8 @@ tap.test('should register an add operation', async () => {
|
|||||||
await testDeferred.promise;
|
await testDeferred.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should stop the watch process', async () => {
|
tap.test('should stop the watch process', async (tools) => {
|
||||||
|
await tools.delayFor(10000);
|
||||||
testSmartchok.stop();
|
testSmartchok.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartchok',
|
name: '@push.rocks/smartchok',
|
||||||
version: '1.0.32',
|
version: '1.0.33',
|
||||||
description: 'smart wrapper for chokidar'
|
description: 'smart wrapper for chokidar'
|
||||||
}
|
}
|
||||||
|
@ -95,10 +95,14 @@ export class Smartchok {
|
|||||||
const done = plugins.smartpromise.defer<void>();
|
const done = plugins.smartpromise.defer<void>();
|
||||||
this.status = 'starting';
|
this.status = 'starting';
|
||||||
this.watcher = new plugins.watcher(
|
this.watcher = new plugins.watcher(
|
||||||
this.watchStringmap.getStringArray().map((string) => this.getGlobBase(string)),
|
this.watchStringmap.getStringArray().map((string) => {
|
||||||
|
const result = this.getGlobBase(string);
|
||||||
|
console.log(`Watching ${result} for changes`);
|
||||||
|
return result;
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
depth: 20,
|
depth: 20,
|
||||||
recursive: true,
|
recursive: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.watcher.on('ready', () => {
|
this.watcher.on('ready', () => {
|
||||||
|
Reference in New Issue
Block a user