tasks/index.js
function queueTasks (testTasks, buildTasks) {
      // Queue up test tasks, removing them if already queued up
      _.forEach({ test: testTasks, build: buildTasks }, (queuingTasks, type) => {
        _.forEach(queuingTasks, (task) => {
          // Remove if already queued
          const removed = _.remove(queue[type], (queuedTask) => { return (queuedTask === task); });
          // Queue task ...
          queue[type].push(task);
          // Reorder tasks by original configuration ordering
          queue[type] = _.sortBy(queue[type], (queuedTask) => {
            return _.findIndex(orderedTasks, (originalTask) => {
              return (originalTask === queuedTask);
            });
          });
          // Prompt queued task
          console.log(`> ${removed.length ? 'Requeued' : 'Queued'} ${ type } task for execution: "${ task.blue }"`);
          console.log(`  Queue: ${ [...queue.test, ...queue.build].join(', ').gray }`);
        });
      });
      // Execute tasks from the queue
      executeQueuedTasks();
    }
function queueTasks (testTasks, buildTasks) {
      // Queue up test tasks, removing them if already queued up
      _.forEach({ test: testTasks, build: buildTasks }, (queuingTasks, type) => {
        _.forEach(queuingTasks, (task) => {
          // Remove if already queued
          const removed = _.remove(queue[type], (queuedTask) => { return (queuedTask === task); });
          // Queue task ...
          queue[type].push(task);
          // Reorder tasks by original configuration ordering
          queue[type] = _.sortBy(queue[type], (queuedTask) => {
            return _.findIndex(orderedTasks, (originalTask) => {
              return (originalTask === queuedTask);
            });
          });
          // Prompt queued task
          console.log(`> ${removed.length ? 'Requeued' : 'Queued'} ${ type } task for execution: "${ task.blue }"`);
          console.log(`  Queue: ${ [...queue.test, ...queue.build].join(', ').gray }`);
        });
      });
      // Execute tasks from the queue
      executeQueuedTasks();
    }
function queueTasks ( testTasks , buildTasks ) { // Queue up test tasks, removing them if already queued up _ . forEach ( { test : testTasks , build : buildTasks } , ( queuingTasks , type ) => { _ . forEach ( queuingTasks , ( task ) => { // Remove if already queued const removed = _ . remove ( queue [ type ] , ( queuedTask ) => { return ( queuedTask === task ) ; } ) ; // Queue task ... queue [ type ] . push ( task ) ; // Reorder tasks by original configuration ordering queue [ type ] = _ . sortBy ( queue [ type ] , ( queuedTask ) => { return _ . findIndex ( orderedTasks , ( originalTask ) => { return ( originalTask === queuedTask ) ; } ) ; } ) ; // Prompt queued task console . log ( ` ${ removed . length ? 'Requeued' : 'Queued' } ${ type } ${ task . blue } ` ) ; console . log ( ` ${ [ ... queue . test , ... queue . build ] . join ( ', ' ) . gray } ` ) ; } ) ; } ) ; // Execute tasks from the queue executeQueuedTasks ( ) ; }
Queues up tasks for execution
@param {any} testTasks Array of test tasks names
@param {any} buildTasks Array of build task names
Queues up tasks for execution