Zotero translator does not work with testCases

I'm trying to write a web translator, which is pretty much functional. However, I'm experiencing a problem with adding var testCases.

Both detectWeb() and doWeb() work on Scaffold (on FF55 and Zotero 4) and I can import an item through Zotero icon successfully as long as there is no testCases variable.

However, once I add a code for var testCases into the Tests pane of Scaffold, as shown here (https://www.zotero.org/support/dev/translators/testing), then Zotero button does not show the translator I'm developing, even though it still returns a correct item on Scaffold. I've also noticed that adding testCase code with item data copied from Scaffold output is not reflected by the Testing pane; nothing shows up in this pane.

Further, although I can save the testCase code by Scaffold's Save button, when I load the saved translator by Load button, the Tests pane is empty.

Apparently, something is wrong about testCases, but I'm not sure what. Your suggestions will be appreciated.



translator code

https://gist.github.com/kouichi-c-nakamura/3a0bf4365beb9156e888330e89507d21

Cheers,
Kouichi
Sign In or Register to comment.