with one click
create-test
// Create or update test cases for a Zotero translator by running it against live URLs and capturing the output.
// Create or update test cases for a Zotero translator by running it against live URLs and capturing the output.
Analyze a website's API by capturing network traffic (HAR) and generating an OpenAPI spec via mitmproxy2swagger.
Develop an export translator that converts Zotero items into a file format (JSON, XML, CSV, etc.).
Develop an import translator that parses a file format (JSON, XML, RIS, BibTeX, CSV, etc.) into Zotero items.
Develop a search translator that looks up items by identifier (DOI, ISBN, PMID, arXiv ID, etc.) via an external API. NOT for websites with search pages — use develop-web-translator for those.
Develop a web translator that scrapes bibliographic data from a website. This is the most common translator type.
Inspect a live web page using headless Chrome. Gets screenshots, meta tags, accessibility tree, and runs CSS selectors or JS expressions against the rendered DOM.
| name | create-test |
| description | Create or update test cases for a Zotero translator by running it against live URLs and capturing the output. |
Test cases are embedded at the end of each translator file between /** BEGIN TEST CASES **/ and /** END TEST CASES **/. They look like JS but the content is strict JSON — double-quoted keys, no trailing commas, no comments, no single quotes. The linter enforces this.
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://example.com/article/123",
"items": [
{
"itemType": "journalArticle",
"title": "Example Article",
...
}
]
}
]
/** END TEST CASES **/
The tool runs the translator, captures its output, and writes the test case JSON directly into the file. Do NOT hand-write test case item objects.
node .bin/create-test.mjs "<translator filename>" --url "<url>"
node .bin/create-test.mjs "<translator filename>" --search '{"DOI":"10.1234/example"}'
node .bin/create-test.mjs "<translator filename>" --input "<import data>"
Export tests are not supported by the automated test runner. Test export translators manually.
--no-write: Preview the captured test case without modifying the file.--json: Output structured JSON."multiple" test (if supported).