mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
core: fix warnings in tests
This commit is contained in:
@@ -60,13 +60,13 @@ test("add invalid note", () =>
|
||||
databaseTest().then(async (db) => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
expect(db.notes.add()).rejects.toThrow();
|
||||
await expect(db.notes.add()).rejects.toThrow();
|
||||
|
||||
expect(db.notes.add({})).rejects.toThrow();
|
||||
await expect(db.notes.add({})).rejects.toThrow();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
expect(db.notes.add({ hello: "world" })).rejects.toThrow();
|
||||
await expect(db.notes.add({ hello: "world" })).rejects.toThrow();
|
||||
}));
|
||||
|
||||
test("add note", () =>
|
||||
|
||||
@@ -31,6 +31,7 @@ import { tmpdir } from "os";
|
||||
import { getId } from "../../src/utils/id.js";
|
||||
import { existsSync, mkdirSync } from "fs";
|
||||
import * as betterTrigram from "sqlite-better-trigram";
|
||||
import * as fts5Html from "sqlite3-fts5-html";
|
||||
|
||||
const TEST_NOTEBOOK: Partial<Notebook> = {
|
||||
title: "Test Notebook",
|
||||
@@ -65,6 +66,7 @@ function databaseTest(type: "memory" | "persistent" = "memory") {
|
||||
batchSize: 500
|
||||
});
|
||||
betterTrigram.load(betterSqliteDb);
|
||||
fts5Html.load(betterSqliteDb);
|
||||
return db.init().then(() => db);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ test("create vault", () =>
|
||||
test("lock vault", () =>
|
||||
databaseTest().then(async (db) => {
|
||||
await expect(db.vault.create("password")).resolves.toBe(true);
|
||||
expect(db.vault.lock()).resolves.toBe(true);
|
||||
await expect(db.vault.lock()).resolves.toBe(true);
|
||||
}));
|
||||
|
||||
test("lock non-existent vault", () =>
|
||||
databaseTest().then(async (db) => {
|
||||
expect(db.vault.lock()).resolves.toBe(true);
|
||||
await expect(db.vault.lock()).resolves.toBe(true);
|
||||
}));
|
||||
|
||||
test("unlock vault", () =>
|
||||
|
||||
Reference in New Issue
Block a user