Converted tests to typescript.

This commit is contained in:
SamTV12345 2024-02-22 15:43:31 +01:00
parent 4bd27a1c79
commit 600f9138f7
42 changed files with 897 additions and 719 deletions

View file

@ -1,30 +0,0 @@
'use strict';
const AuthorManager = require('../../../node/db/AuthorManager');
const assert = require('assert').strict;
const common = require('../common');
const db = require('../../../node/db/DB');
describe(__filename, function () {
let setBackup;
before(async function () {
await common.init();
setBackup = db.set;
db.set = async (...args) => {
// delay db.set
await new Promise((resolve) => { setTimeout(() => resolve(), 500); });
return await setBackup.call(db, ...args);
};
});
after(async function () {
db.set = setBackup;
});
it('regression test for missing await in createAuthor (#5000)', async function () {
const {authorID} = await AuthorManager.createAuthor(); // Should block until db.set() finishes.
assert(await AuthorManager.doesAuthorExist(authorID));
});
});