diff --git a/src/quarto.ts b/src/quarto.ts index 54f4b3f00da..a0c61b831c1 100644 --- a/src/quarto.ts +++ b/src/quarto.ts @@ -119,7 +119,7 @@ export async function quarto( await checkReconfiguration(); checkVersionRequirement(); if (args[0] === "pandoc" && args[1] !== "help") { - await passThroughPandoc(args.slice(1), env); + await passThroughPandoc(args, env); } if (args[0] === "typst") { await passThroughTypst(args, env); diff --git a/tests/smoke/run/command-passthrough.test.ts b/tests/smoke/run/command-passthrough.test.ts new file mode 100644 index 00000000000..db89356b3fd --- /dev/null +++ b/tests/smoke/run/command-passthrough.test.ts @@ -0,0 +1,22 @@ +import { assert } from "testing/asserts"; +import { execProcess } from "../../../src/core/process.ts"; +import { quartoDevCmd } from "../../utils.ts"; +import { unitTest } from "../../test.ts"; + +const testPassthroughCmd = (name: string, command: string, args: string[]) => { + unitTest(name, async () => { + const result = await execProcess({ + cmd: [ + quartoDevCmd(), + command, + ...args, + ] + }); + assert(result.success); + }); +} + +// Check Pandoc passthrough +testPassthroughCmd("passthrough-pandoc", "pandoc", ["--version"]); +// Check Typst passthrough +testPassthroughCmd("passthrough-typst", "typst", ["--version"]); \ No newline at end of file diff --git a/tests/test.ts b/tests/test.ts index 676eaa62fcd..c346a0f2b60 100644 --- a/tests/test.ts +++ b/tests/test.ts @@ -5,7 +5,7 @@ * */ import { existsSync } from "../src/deno_ral/fs.ts"; -import { fail } from "testing/asserts"; +import { AssertionError, fail } from "testing/asserts"; import { warning } from "../src/deno_ral/log.ts"; import { initDenoDom } from "../src/core/deno-dom.ts"; @@ -153,7 +153,10 @@ export function unitTest( { name: `${name}`, verify: async (_outputs: ExecuteOutput[]) => { - await ver(); + const timeout = new Promise((_resolve, reject) => { + setTimeout(() => reject(new AssertionError(`timed out after 2 minutes. Something may be wrong with verify function in the test '${name}'.`)), 120000); + }); + await Promise.race([ver(), timeout]); }, }, ],