diff --git a/test/tests/dbTest.js b/test/tests/dbTest.js index 21516a65c1..8339e3972e 100644 --- a/test/tests/dbTest.js +++ b/test/tests/dbTest.js @@ -309,11 +309,18 @@ describe("Zotero.DB", function() { yield Zotero.DB.queryAsync("DROP TABLE " + tmpTable); }); - it("should time out on nested transactions", function* () { + it("should time out on nested transactions", async function () { var e; - yield Zotero.DB.executeTransaction(function* () { - e = yield getPromiseError( - Zotero.DB.executeTransaction(function* () {}).timeout(250) + await Zotero.DB.executeTransaction(async function () { + e = await getPromiseError( + Promise.race([ + Zotero.Promise.delay(250).then(() => { + var e = new Error; + e.name = "TimeoutError"; + throw e; + }), + Zotero.DB.executeTransaction(async function () {}) + ]) ); }); assert.ok(e);