Fix sync client tests that depend on stubbing concurrentCaller Promise.
Regression since f5c4fb06
This commit is contained in:
parent
f59f3c5f7e
commit
a532af6114
2 changed files with 6 additions and 1 deletions
|
@ -64,7 +64,8 @@ Zotero.Sync.Runner_Module = function (options = {}) {
|
||||||
numConcurrent: 4,
|
numConcurrent: 4,
|
||||||
stopOnError,
|
stopOnError,
|
||||||
logger: msg => Zotero.debug(msg),
|
logger: msg => Zotero.debug(msg),
|
||||||
onError: e => Zotero.logError(e)
|
onError: e => Zotero.logError(e),
|
||||||
|
Promise: Zotero.Promise
|
||||||
});
|
});
|
||||||
|
|
||||||
var _enabled = false;
|
var _enabled = false;
|
||||||
|
|
|
@ -66,6 +66,8 @@ if (!(typeof process === 'object' && process + '' === '[object process]')) {
|
||||||
* @param {Integer} [options.interval] - Interval between the end of one function run and the
|
* @param {Integer} [options.interval] - Interval between the end of one function run and the
|
||||||
* beginning of another, in milliseconds
|
* beginning of another, in milliseconds
|
||||||
* @param {Function} [options.logger]
|
* @param {Function} [options.logger]
|
||||||
|
* @param {Object} [options.Promise] The Zotero instance of Promise to allow
|
||||||
|
* stubbing/spying in tests
|
||||||
*/
|
*/
|
||||||
ConcurrentCaller = function (options = {}) {
|
ConcurrentCaller = function (options = {}) {
|
||||||
if (typeof options == 'number') {
|
if (typeof options == 'number') {
|
||||||
|
@ -77,6 +79,8 @@ ConcurrentCaller = function (options = {}) {
|
||||||
|
|
||||||
if (!options.numConcurrent) throw new Error("numConcurrent must be provided");
|
if (!options.numConcurrent) throw new Error("numConcurrent must be provided");
|
||||||
|
|
||||||
|
if (options.Promise) Promise = options.Promise;
|
||||||
|
|
||||||
this.stopOnError = options.stopOnError || false;
|
this.stopOnError = options.stopOnError || false;
|
||||||
this.onError = options.onError || null;
|
this.onError = options.onError || null;
|
||||||
this.numConcurrent = options.numConcurrent;
|
this.numConcurrent = options.numConcurrent;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue