fix(tests): now using tstest

This commit is contained in:
2018-08-04 17:53:22 +02:00
parent df18aba4b5
commit f60deddadd
37 changed files with 1607 additions and 1659 deletions

View File

@@ -1,24 +1,21 @@
import * as plugins from './taskbuffer.plugins'
import * as plugins from './taskbuffer.plugins';
import { Task, ITaskFunction} from './taskbuffer.classes.task'
import { Task, ITaskFunction } from './taskbuffer.classes.task';
/**
* TaskOnce is run exactly once, no matter how often it is triggered
*/
export class TaskOnce extends Task {
hasTriggered: boolean = false
constructor (optionsArg: {
name?: string,
taskFunction: ITaskFunction
}) {
hasTriggered: boolean = false;
constructor(optionsArg: { name?: string; taskFunction: ITaskFunction }) {
super({
name: optionsArg.name,
taskFunction: async () => {
if (!this.hasTriggered) {
this.hasTriggered = true
await optionsArg.taskFunction()
this.hasTriggered = true;
await optionsArg.taskFunction();
}
}
})
});
}
}
}