mirror of https://github.com/status-im/metro.git
packager: simplify ScribeLogger-test
Reviewed By: cpojer Differential Revision: D4481570 fbshipit-source-id: 27beae850806d8d7f526a3196b2962a18e514007
This commit is contained in:
parent
00940db5d5
commit
9577837f99
|
@ -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();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue