Converted tests to typescript. (#6181)

* Converted tests to typescript.

* Run all tests.

* Fixed tests.

* Removed cypress from every installation.

* Use cache for libreoffice.

* Fixed cypress install.

* Fixed cypress install.
This commit is contained in:
SamTV12345 2024-02-22 18:31:17 +01:00 committed by GitHub
parent 4bd27a1c79
commit 546ede284c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 912 additions and 734 deletions

View file

@ -0,0 +1,30 @@
'use strict';
const AuthorManager = require('../../../node/db/AuthorManager');
import {strict as assert} from "assert";
const common = require('../common');
const db = require('../../../node/db/DB');
describe(__filename, function () {
let setBackup: Function;
before(async function () {
await common.init();
setBackup = db.set;
db.set = async (...args:any) => {
// delay db.set
await new Promise<void>((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));
});
});