test: add unit test for graphicsmagick.ts

This commit is contained in:
Jörg Krzeslak 2025-07-24 13:18:16 +02:00
parent 72b484a480
commit 7f9c8868fd
2 changed files with 22 additions and 2 deletions

View file

@ -1,4 +1,5 @@
import { execFile } from "node:child_process";
import { execFile as execFileOriginal } from "node:child_process";
import { ExecFileFn } from "./types.ts";
export const properties = {
from: {
@ -313,8 +314,8 @@ export function convert(
fileType: string,
convertTo: string,
targetPath: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
options?: unknown,
execFile: ExecFileFn = execFileOriginal,
): Promise<string> {
return new Promise((resolve, reject) => {
execFile("gm", ["convert", filePath, targetPath], (error, stdout, stderr) => {