fix(core): update
This commit is contained in:
13
test/test.ts
13
test/test.ts
@ -19,26 +19,23 @@ tap.test('should create a new instance', async () => {
|
||||
|
||||
tap.test('should add some files to watch and start', async () => {
|
||||
testSmartchok.add(['./test/assets/**/*.txt']);
|
||||
let localPromise = testSmartchok.start().then(async () => {
|
||||
testSmartchok.add(['./test/assets/**/*.md']);
|
||||
});
|
||||
await expect(localPromise).to.eventually.be.fulfilled;
|
||||
await testSmartchok.start()
|
||||
testSmartchok.add(['./test/assets/**/*.md']);
|
||||
});
|
||||
|
||||
tap.test('should get an observable for a certain event', async () => {
|
||||
let localPromise = testSmartchok.getObservableFor('add').then(async observableArg => {
|
||||
await testSmartchok.getObservableFor('add').then(async (observableArg) => {
|
||||
testAddObservable = observableArg;
|
||||
});
|
||||
await expect(localPromise).to.eventually.be.fulfilled;
|
||||
});
|
||||
|
||||
tap.test('should register an add operation', async () => {
|
||||
let testDeferred = smartpromise.defer();
|
||||
testSubscription = testAddObservable.subscribe(x => {
|
||||
testSubscription = testAddObservable.subscribe((x) => {
|
||||
testDeferred.resolve();
|
||||
});
|
||||
smartfile.memory.toFs('HI', './test/assets/hi.txt');
|
||||
await expect(testDeferred.promise).to.eventually.be.fulfilled;
|
||||
await testDeferred.promise;
|
||||
});
|
||||
|
||||
tap.test('should stop the watch process', async () => {
|
||||
|
Reference in New Issue
Block a user