fix(tests): now using tstest
This commit is contained in:
@@ -1,28 +1,25 @@
|
||||
import * as plugins from './taskbuffer.plugins'
|
||||
import * as helpers from './taskbuffer.classes.helpers'
|
||||
import { Task } from './taskbuffer.classes.task'
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
import * as helpers from './taskbuffer.classes.helpers';
|
||||
import { Task } from './taskbuffer.classes.task';
|
||||
|
||||
export class Taskparallel extends Task {
|
||||
taskArray: Task[]
|
||||
constructor (optionsArg: {
|
||||
taskArray: Task[]
|
||||
}) {
|
||||
let options = plugins.lodash.merge(
|
||||
optionsArg,
|
||||
{
|
||||
taskArray: Task[];
|
||||
constructor(optionsArg: { taskArray: Task[] }) {
|
||||
const options = {
|
||||
...optionsArg,
|
||||
...{
|
||||
taskFunction: () => {
|
||||
let done = plugins.q.defer()
|
||||
let promiseArray: Promise<any>[] = [] // stores promises of all tasks, since they run in parallel
|
||||
this.taskArray.forEach(function (taskArg) {
|
||||
promiseArray.push(taskArg.trigger())
|
||||
})
|
||||
Promise.all(promiseArray)
|
||||
.then(done.resolve)
|
||||
return done.promise
|
||||
let done = plugins.smartpromise.defer();
|
||||
let promiseArray: Promise<any>[] = []; // stores promises of all tasks, since they run in parallel
|
||||
this.taskArray.forEach(function(taskArg) {
|
||||
promiseArray.push(taskArg.trigger());
|
||||
});
|
||||
Promise.all(promiseArray).then(done.resolve);
|
||||
return done.promise;
|
||||
}
|
||||
}
|
||||
)
|
||||
super(options)
|
||||
this.taskArray = optionsArg.taskArray
|
||||
};
|
||||
super(options);
|
||||
this.taskArray = optionsArg.taskArray;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user