mirror of
https://github.com/zadam/trilium.git
synced 2026-03-10 02:13:38 +01:00
test(server): fake timers not restored
This commit is contained in:
parent
9b4f8c5003
commit
db0c515bad
@ -2,7 +2,7 @@ import { dayjs } from "@triliumnext/commons";
|
||||
import type { Application } from "express";
|
||||
import { SessionData } from "express-session";
|
||||
import supertest, { type Response } from "supertest";
|
||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import cls from "../services/cls.js";
|
||||
import { type SQLiteSessionStore } from "./session_parser.js";
|
||||
@ -20,6 +20,10 @@ describe("Login Route test", () => {
|
||||
({ sessionStore, CLEAN_UP_INTERVAL } = (await import("./session_parser.js")));
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it("should return the login page, when using a GET request", async () => {
|
||||
|
||||
// RegExp for login page specific string in HTML
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Application, NextFunction,Request, Response } from "express";
|
||||
import supertest from "supertest";
|
||||
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { safeExtractMessageAndStackFromError } from "../services/utils.js";
|
||||
|
||||
@ -23,6 +23,10 @@ describe("Share API test", () => {
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
cannotSetHeadersCount = 0;
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user