test: change order of parameters in ExecFileFn type

This commit is contained in:
Jörg Krzeslak
2025-07-24 19:33:55 +02:00
parent eac22d53d3
commit af68498494
24 changed files with 36 additions and 68 deletions

View File

@@ -42,7 +42,6 @@ test("convert respects eps filetype", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);
@@ -69,7 +68,6 @@ test("convert respects pdf filetype", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);
@@ -96,7 +94,6 @@ test("convert respects svgz conversion target type", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);

View File

@@ -6,7 +6,6 @@ let calls: string[][] = [];
function mockExecFile(
_cmd: string,
args: string[],
options: unknown,
callback: (err: Error | null, stdout: string, stderr: string) => void,
) {
calls.push(args);

View File

@@ -13,7 +13,6 @@ export async function runConvertSuccessTest(convertFn: ConvertFnWithExecFile) {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
callback(null, "Fake stdout", "");
@@ -31,7 +30,6 @@ export async function runConvertFailTest(convertFn: ConvertFnWithExecFile) {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
callback(new Error("Test error"), "", "");
@@ -53,7 +51,6 @@ export async function runConvertLogsStderror(convertFn: ConvertFnWithExecFile) {
const mockExecFile = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: Error | null, stdout: string, stderr: string) => void,
) => {
callback(null, "", "Fake stderr");
@@ -82,7 +79,6 @@ export async function runConvertLogsStderrorAndStdout(convertFn: ConvertFnWithEx
const mockExecFile = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: Error | null, stdout: string, stderr: string) => void,
) => {
callback(null, "Fake stdout", "Fake stderr");

View File

@@ -42,7 +42,6 @@ test("convert respects ico conversion target type", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);
@@ -78,7 +77,6 @@ test("convert respects ico conversion target type with svg as input filetype", a
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);
@@ -116,7 +114,6 @@ test("convert respects ico conversion target type with emf as input filetype", a
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);
@@ -158,7 +155,6 @@ test("convert respects emf as input filetype", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);

View File

@@ -42,7 +42,6 @@ test("convert uses djxl with input filetype being jxl", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
command = _cmd;
@@ -69,7 +68,6 @@ test("convert uses cjxl with output filetype being jxl", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
command = _cmd;

View File

@@ -7,7 +7,6 @@ test("convert rejects conversion if input filetype is not msg and output type is
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
callback(null, "Fake stdout", "");
@@ -26,7 +25,6 @@ test("convert rejects conversion on error", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
callback(new Error("Test error"), "", "");
@@ -50,7 +48,6 @@ test("convert logs stderr as warning", async () => {
const mockExecFile = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: Error | null, stdout: string, stderr: string) => void,
) => {
callback(null, "", "Fake stderr");

View File

@@ -42,7 +42,6 @@ test("convert uses action pdfload with filetype being pdf", async () => {
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);
@@ -69,7 +68,6 @@ test("convert uses action copy with filetype being anything but pdf", async () =
const mockExecFile: ExecFileFn = (
_cmd: string,
_args: string[],
options: unknown,
callback: (err: ExecFileException | null, stdout: string, stderr: string) => void,
) => {
calls.push(_args);