packager: simplify ScribeLogger-test

Reviewed By: cpojer

Differential Revision: D4481570

fbshipit-source-id: 27beae850806d8d7f526a3196b2962a18e514007
This commit is contained in:
Jean Lauliac 2017-01-30 07:32:36 -08:00 committed by Facebook Github Bot
parent 00940db5d5
commit 9577837f99
1 changed files with 1 additions and 2 deletions

View File

@ -23,13 +23,12 @@ class BatchProcessorMock {
this._queue.push([item, callback]); this._queue.push([item, callback]);
} }
flush(callback) { flushMock() {
const {_queue} = this; const {_queue} = this;
this._queue = []; this._queue = [];
process.nextTick(() => { process.nextTick(() => {
this._processBatch(_queue.map(pair => pair[0]), (error, res) => { this._processBatch(_queue.map(pair => pair[0]), (error, res) => {
_queue.forEach((pair, i) => pair[1](error, res && res[i])); _queue.forEach((pair, i) => pair[1](error, res && res[i]));
callback();
}); });
}); });
} }