chore(test): disable download of images

This commit is contained in:
Elian Doran 2025-02-26 18:58:08 +02:00
parent ef736edf09
commit bd933dde28
No known key found for this signature in database
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { beforeAll, describe, expect, it } from "vitest"; import { beforeAll, describe, expect, it, vi } from "vitest";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
@ -42,6 +42,13 @@ async function testImport(fileName: string, mimetype: string) {
describe("processNoteContent", () => { describe("processNoteContent", () => {
beforeAll(async () => { beforeAll(async () => {
// Prevent download of images.
vi.mock("../image.js", () => {
return {
default: { saveImageToAttachment: () => {} }
};
});
initializeTranslations(); initializeTranslations();
sql_init.initializeDb(); sql_init.initializeDb();
await sql_init.dbReady; await sql_init.dbReady;

View File

@ -1,4 +1,4 @@
import { beforeAll, describe, expect, it } from "vitest"; import { beforeAll, describe, expect, it, vi } from "vitest";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
@ -37,6 +37,13 @@ async function testImport(fileName: string) {
describe("processNoteContent", () => { describe("processNoteContent", () => {
beforeAll(async () => { beforeAll(async () => {
// Prevent download of images.
vi.mock("../image.js", () => {
return {
default: { saveImageToAttachment: () => {} }
};
});
initializeTranslations(); initializeTranslations();
sql_init.initializeDb(); sql_init.initializeDb();
await sql_init.dbReady; await sql_init.dbReady;