mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	chore(test): disable download of images
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| import { beforeAll, describe, expect, it } from "vitest"; | ||||
| import { beforeAll, describe, expect, it, vi } from "vitest"; | ||||
| import fs from "fs"; | ||||
| import path from "path"; | ||||
| import { fileURLToPath } from "url"; | ||||
| @@ -42,6 +42,13 @@ async function testImport(fileName: string, mimetype: string) { | ||||
|  | ||||
| describe("processNoteContent", () => { | ||||
|     beforeAll(async () => { | ||||
|         // Prevent download of images. | ||||
|         vi.mock("../image.js", () => { | ||||
|             return { | ||||
|                 default: { saveImageToAttachment: () => {} } | ||||
|             }; | ||||
|         }); | ||||
|  | ||||
|         initializeTranslations(); | ||||
|         sql_init.initializeDb(); | ||||
|         await sql_init.dbReady; | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { beforeAll, describe, expect, it } from "vitest"; | ||||
| import { beforeAll, describe, expect, it, vi } from "vitest"; | ||||
| import fs from "fs"; | ||||
| import path from "path"; | ||||
| import { fileURLToPath } from "url"; | ||||
| @@ -37,6 +37,13 @@ async function testImport(fileName: string) { | ||||
|  | ||||
| describe("processNoteContent", () => { | ||||
|     beforeAll(async () => { | ||||
|         // Prevent download of images. | ||||
|         vi.mock("../image.js", () => { | ||||
|             return { | ||||
|                 default: { saveImageToAttachment: () => {} } | ||||
|             }; | ||||
|         }); | ||||
|  | ||||
|         initializeTranslations(); | ||||
|         sql_init.initializeDb(); | ||||
|         await sql_init.dbReady; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user