test: add unit test for inkscape.ts
This commit is contained in:
parent
f1730ede97
commit
7524f304fe
4 changed files with 24 additions and 4 deletions
|
|
@ -315,7 +315,7 @@ export function convert(
|
|||
convertTo: string,
|
||||
targetPath: string,
|
||||
options?: unknown,
|
||||
execFile: ExecFileFn = execFileOriginal,
|
||||
execFile: ExecFileFn = execFileOriginal, // to make it mockable
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
execFile("gm", ["convert", filePath, targetPath], (error, stdout, stderr) => {
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ export function convert(
|
|||
convertTo: string,
|
||||
targetPath: string,
|
||||
options?: unknown,
|
||||
execFile: ExecFileFn = execFileOriginal,
|
||||
execFile: ExecFileFn = execFileOriginal, // to make it mockable
|
||||
): Promise<string> {
|
||||
let outputArgs: string[] = [];
|
||||
let inputArgs: string[] = [];
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
@ -32,8 +33,8 @@ export function convert(
|
|||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
execFile: ExecFileFn = execFileOriginal, // to make it mockable
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
execFile("inkscape", [filePath, "-o", targetPath], (error, stdout, stderr) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue