Ensure http server is initialized for translate tests
This commit is contained in:
parent
5c7b4019d9
commit
53fd416011
1 changed files with 4 additions and 2 deletions
|
@ -95,7 +95,7 @@ function getTestPDF() {
|
|||
* This must happen immediately before the test, since Zotero might get
|
||||
* restarted by resetDB(), which would erase our registered endpoints.
|
||||
*/
|
||||
function setupAttachmentEndpoints() {
|
||||
async function setupAttachmentEndpoints() {
|
||||
var SnapshotTest = function() {};
|
||||
Zotero.Server.Endpoints["/test/translate/test.html"] = SnapshotTest;
|
||||
SnapshotTest.prototype = {
|
||||
|
@ -124,6 +124,8 @@ function setupAttachmentEndpoints() {
|
|||
sendResponseCallback(404, "text/html", "File does not exist");
|
||||
}
|
||||
}
|
||||
Zotero.Prefs.set("httpServer.enabled", true);
|
||||
await Zotero.Server.init();
|
||||
}
|
||||
|
||||
describe("Zotero.Translate", function() {
|
||||
|
@ -133,7 +135,7 @@ describe("Zotero.Translate", function() {
|
|||
this.timeout(20000);
|
||||
yield Zotero.Translators.init();
|
||||
|
||||
setupAttachmentEndpoints();
|
||||
yield setupAttachmentEndpoints();
|
||||
win = yield loadBrowserWindow();
|
||||
});
|
||||
after(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue