Skip to content

Commit

Permalink
Testing: Fix failure to run non-web translators' tests in debug build.
Browse files Browse the repository at this point in the history
- In the testTranslators tool included in the debug build, there is an
  incorrect script path preventing the type schema data from loading.
- In cachedTypes.js, the callback passed to `getSchema()` is not called.
  (The call site is in `translatorTester_viewer.js`).

The overall effect is that non-web translators' test code did not run at
all.

This is fixed by including the correct script path, and call the
callback in `getSchema()`.
  • Loading branch information
zoe-translates committed Mar 27, 2023
1 parent 4155303 commit 734faa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/common/cachedTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Zotero.Connector_Types = new function() {
/**
* Passes schema to a callback
*/
this.getSchema = async function() {
return TypeSchema;
this.getSchema = async function(callback) {
return callback(TypeSchema);
};
}
}
4 changes: 2 additions & 2 deletions src/common/tools/testTranslators/testTranslators.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script type="text/javascript" src="/zotero_config.js"></script>
<script type="text/javascript" src="/zotero.js"></script>
<script type="text/javascript" src="/translate/promise.js"></script>
<script type="text/javascript" src="/translate/resource/zoteroTypeSchemaData.js"></script>
<script type="text/javascript" src="/utilities/resource/zoteroTypeSchemaData.js"></script>
<script type="text/javascript" src="/utilities/schema.js"></script>
<script type="text/javascript" src="/cachedTypes.js"></script>
<script type="text/javascript" src="/schema.js"></script>
Expand Down Expand Up @@ -65,4 +65,4 @@
</head>
<body>
</body>
</html>
</html>

0 comments on commit 734faa3

Please sign in to comment.