www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit a43f9d16ac0279034c80c1c4a65b5d6e3b38417d
parent edb08e179c817993d33344bfd62aeac1ca6917a7
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 23 Jan 2017 08:58:16 -0500

Allow number or name for translator type in buildDummyTranslator()

This reverts c6b78da69d6, which changed it to expect numbers when I
noticed the type being undefined in debug output, but apparently the
only tests where the type actually mattered passed it as a name.

At some point we should just change all tests to pass as a name.

Diffstat:
Mtest/content/support.js | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/content/support.js b/test/content/support.js @@ -776,10 +776,10 @@ var generateTranslatorExportData = Zotero.Promise.coroutine(function* generateTr * Build a dummy translator that can be passed to Zotero.Translate */ function buildDummyTranslator(translatorType, code, info={}) { - const TRANSLATOR_TYPES = {1: "import", 2: "export", 4: "web", 8: "search"}; + const TRANSLATOR_TYPES = {"import":1, "export":2, "web":4, "search":8}; info = Object.assign({ "translatorID":"dummy-translator", - "translatorType":TRANSLATOR_TYPES[translatorType], + "translatorType": Number.isInteger(translatorType) ? translatorType : TRANSLATOR_TYPES[translatorType], "label":"Dummy Translator", "creator":"Simon Kornblith", "target":"",