diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js index 6734eee6ac..44cd4768f5 100644 --- a/chrome/content/zotero/tools/testTranslators/translatorTester.js +++ b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -30,11 +30,7 @@ var EXPORTED_SYMBOLS = ["Zotero_TranslatorTesters"]; // For debugging specific translators by label var includeTranslators = []; -try { - Zotero; -} catch(e) { - var Zotero; -} +this.Zotero = Zotero; var Zotero_TranslatorTesters = new function() { const TEST_TYPES = ["web", "import", "export", "search"]; @@ -46,11 +42,13 @@ var Zotero_TranslatorTesters = new function() { this.runAllTests = function (numConcurrentTests, skipTranslators, writeDataCallback) { var id = Math.random() * (100000000 - 1) + 1; - waitForDialog(); + if (!(typeof process === 'object' && process + '' === '[object process]')){ + waitForDialog(); - if(!Zotero) { - Zotero = Components.classes["@zotero.org/Zotero;1"] - .getService(Components.interfaces.nsISupports).wrappedJSObject; + if(!Zotero) { + Zotero = Components.classes["@zotero.org/Zotero;1"] + .getService(Components.interfaces.nsISupports).wrappedJSObject; + } } var testers = []; @@ -759,4 +757,8 @@ Zotero_TranslatorTester._generateDiff = new function() { var txt = compare(a, b); return txt.substr(0, txt.length-1); }; -}; \ No newline at end of file +}; + +if (typeof process === 'object' && process + '' === '[object process]'){ + module.exports = Zotero_TranslatorTesters; +}