Skip to content

Commit bc8b03a

Browse files
authored
Merge pull request #11449 from quarto-dev/fix/passthrough-cmd
2 parents a76b043 + 09c2f42 commit bc8b03a

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

src/quarto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export async function quarto(
119119
await checkReconfiguration();
120120
checkVersionRequirement();
121121
if (args[0] === "pandoc" && args[1] !== "help") {
122-
await passThroughPandoc(args.slice(1), env);
122+
await passThroughPandoc(args, env);
123123
}
124124
if (args[0] === "typst") {
125125
await passThroughTypst(args, env);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { assert } from "testing/asserts";
2+
import { execProcess } from "../../../src/core/process.ts";
3+
import { quartoDevCmd } from "../../utils.ts";
4+
import { unitTest } from "../../test.ts";
5+
6+
const testPassthroughCmd = (name: string, command: string, args: string[]) => {
7+
unitTest(name, async () => {
8+
const result = await execProcess({
9+
cmd: [
10+
quartoDevCmd(),
11+
command,
12+
...args,
13+
]
14+
});
15+
assert(result.success);
16+
});
17+
}
18+
19+
// Check Pandoc passthrough
20+
testPassthroughCmd("passthrough-pandoc", "pandoc", ["--version"]);
21+
// Check Typst passthrough
22+
testPassthroughCmd("passthrough-typst", "typst", ["--version"]);

tests/test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
*/
77
import { existsSync } from "../src/deno_ral/fs.ts";
8-
import { fail } from "testing/asserts";
8+
import { AssertionError, fail } from "testing/asserts";
99
import { warning } from "../src/deno_ral/log.ts";
1010
import { initDenoDom } from "../src/core/deno-dom.ts";
1111

@@ -153,7 +153,10 @@ export function unitTest(
153153
{
154154
name: `${name}`,
155155
verify: async (_outputs: ExecuteOutput[]) => {
156-
await ver();
156+
const timeout = new Promise((_resolve, reject) => {
157+
setTimeout(() => reject(new AssertionError(`timed out after 2 minutes. Something may be wrong with verify function in the test '${name}'.`)), 120000);
158+
});
159+
await Promise.race([ver(), timeout]);
157160
},
158161
},
159162
],

0 commit comments

Comments
 (0)