mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	chore(test/server): fix some initialization errors
This commit is contained in:
		
							parent
							
								
									cc07144f21
								
							
						
					
					
						commit
						6e4698cf61
					
				| @ -3,7 +3,6 @@ import supertest from "supertest"; | |||||||
| import { initializeTranslations } from "../services/i18n.js"; | import { initializeTranslations } from "../services/i18n.js"; | ||||||
| import type { Application } from "express"; | import type { Application } from "express"; | ||||||
| import dayjs from "dayjs"; | import dayjs from "dayjs"; | ||||||
| import buildApp from "../app.js"; |  | ||||||
| 
 | 
 | ||||||
| let app: Application; | let app: Application; | ||||||
| 
 | 
 | ||||||
| @ -11,6 +10,7 @@ describe("Login Route test", () => { | |||||||
| 
 | 
 | ||||||
|     beforeAll(async () => { |     beforeAll(async () => { | ||||||
|         initializeTranslations(); |         initializeTranslations(); | ||||||
|  |         const buildApp = (await import("../app.js")).default; | ||||||
|         app = await buildApp(); |         app = await buildApp(); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,4 @@ | |||||||
| import { describe, expect, it } from "vitest"; | import { describe, expect, it } from "vitest"; | ||||||
| import becca from "../becca/becca.js"; |  | ||||||
| import sql from "./sql.js"; | import sql from "./sql.js"; | ||||||
| import migration from "./migration.js"; | import migration from "./migration.js"; | ||||||
| import cls from "./cls.js"; | import cls from "./cls.js"; | ||||||
|  | |||||||
| @ -3,7 +3,6 @@ import supertest from "supertest"; | |||||||
| import { initializeTranslations } from "../services/i18n.js"; | import { initializeTranslations } from "../services/i18n.js"; | ||||||
| import type { Application, Request, Response, NextFunction } from "express"; | import type { Application, Request, Response, NextFunction } from "express"; | ||||||
| import { safeExtractMessageAndStackFromError } from "../services/utils.js"; | import { safeExtractMessageAndStackFromError } from "../services/utils.js"; | ||||||
| import buildApp from "../app.js"; |  | ||||||
| 
 | 
 | ||||||
| let app: Application; | let app: Application; | ||||||
| 
 | 
 | ||||||
| @ -12,6 +11,7 @@ describe("Share API test", () => { | |||||||
| 
 | 
 | ||||||
|     beforeAll(async () => { |     beforeAll(async () => { | ||||||
|         initializeTranslations(); |         initializeTranslations(); | ||||||
|  |         const buildApp = (await import("../app.js")).default; | ||||||
|         app = await buildApp(); |         app = await buildApp(); | ||||||
|         app.use((err: unknown, req: Request, res: Response, next: NextFunction) => { |         app.use((err: unknown, req: Request, res: Response, next: NextFunction) => { | ||||||
|             const [ errMessage ] = safeExtractMessageAndStackFromError(err); |             const [ errMessage ] = safeExtractMessageAndStackFromError(err); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran