File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change 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" ] ) ;
Original file line number Diff line number Diff line change 55*
66*/
77import { existsSync } from "../src/deno_ral/fs.ts" ;
8- import { fail } from "testing/asserts" ;
8+ import { AssertionError , fail } from "testing/asserts" ;
99import { warning } from "../src/deno_ral/log.ts" ;
1010import { 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 ] ,
You can’t perform that action at this time.
0 commit comments