chore(test/server): fix some initialization errors

This commit is contained in:
Elian Doran 2025-04-28 17:02:43 +03:00
parent cc07144f21
commit 6e4698cf61
No known key found for this signature in database
3 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,6 @@ import supertest from "supertest";
import { initializeTranslations } from "../services/i18n.js";
import type { Application } from "express";
import dayjs from "dayjs";
import buildApp from "../app.js";
let app: Application;
@ -11,6 +10,7 @@ describe("Login Route test", () => {
beforeAll(async () => {
initializeTranslations();
const buildApp = (await import("../app.js")).default;
app = await buildApp();
});

View File

@ -1,5 +1,4 @@
import { describe, expect, it } from "vitest";
import becca from "../becca/becca.js";
import sql from "./sql.js";
import migration from "./migration.js";
import cls from "./cls.js";

View File

@ -3,7 +3,6 @@ import supertest from "supertest";
import { initializeTranslations } from "../services/i18n.js";
import type { Application, Request, Response, NextFunction } from "express";
import { safeExtractMessageAndStackFromError } from "../services/utils.js";
import buildApp from "../app.js";
let app: Application;
@ -12,6 +11,7 @@ describe("Share API test", () => {
beforeAll(async () => {
initializeTranslations();
const buildApp = (await import("../app.js")).default;
app = await buildApp();
app.use((err: unknown, req: Request, res: Response, next: NextFunction) => {
const [ errMessage ] = safeExtractMessageAndStackFromError(err);