mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 12:12:54 +01:00
core: fix tests
This commit is contained in:
committed by
Abdullah Atta
parent
561d7a8bbc
commit
fa7900aef6
@@ -22,7 +22,8 @@ import StorageInterface from "../__mocks__/storage.mock";
|
||||
import { login } from "./utils";
|
||||
|
||||
test("refresh token concurrently", async () => {
|
||||
const db = new DB(StorageInterface);
|
||||
const db = new DB();
|
||||
db.setup(StorageInterface);
|
||||
await db.init();
|
||||
|
||||
await expect(login(db)).resolves.not.toThrow();
|
||||
@@ -41,7 +42,8 @@ test("refresh token concurrently", async () => {
|
||||
}, 30000);
|
||||
|
||||
test("refresh token using the same refresh_token multiple time", async () => {
|
||||
const db = new DB(StorageInterface);
|
||||
const db = new DB();
|
||||
db.setup(StorageInterface);
|
||||
await db.init();
|
||||
|
||||
await expect(login(db)).resolves.not.toThrow();
|
||||
|
||||
@@ -22,7 +22,8 @@ import Constants from "../utils/constants";
|
||||
import StorageInterface from "../__mocks__/storage.mock";
|
||||
|
||||
test("db.host should change HOST", () => {
|
||||
const db = new DB(StorageInterface);
|
||||
const db = new DB();
|
||||
db.setup(StorageInterface);
|
||||
db.host({ API_HOST: "hello world" });
|
||||
expect(Constants.API_HOST).toBe("hello world");
|
||||
});
|
||||
|
||||
@@ -37,7 +37,8 @@ const TEST_NOTEBOOK2 = {
|
||||
};
|
||||
|
||||
function databaseTest() {
|
||||
let db = new DB(StorageInterface, null, FS, Compressor);
|
||||
let db = new DB();
|
||||
db.setup(StorageInterface, null, FS, Compressor);
|
||||
return db.init().then(() => db);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user