Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/quarto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 22 additions & 0 deletions tests/smoke/run/command-passthrough.test.ts
Original file line number Diff line number Diff line change
@@ -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"]);
7 changes: 5 additions & 2 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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]);
},
},
],
Expand Down
Loading