@@ -5,19 +5,19 @@ import type { CommandContext } from "../context.ts";
55import { local } from "../utils.ts" ;
66
77function resolveConfig ( ) : string {
8- // Built output (.mjs) or source (.ts)
9- for ( const ext of [ ".mjs" , ".ts" ] ) {
10- const url = new URL ( `../test-utils/vitest.config${ ext } ` , import . meta. url ) ;
11- const path = fileURLToPath ( url ) ;
12- if ( existsSync ( path ) ) return path ;
13- }
14- throw new Error ( "Could not resolve vitest.config file" ) ;
8+ // Built output (.mjs) or source (.ts)
9+ for ( const ext of [ ".mjs" , ".ts" ] ) {
10+ const url = new URL ( `../test-utils/vitest.config${ ext } ` , import . meta. url ) ;
11+ const path = fileURLToPath ( url ) ;
12+ if ( existsSync ( path ) ) return path ;
13+ }
14+ throw new Error ( "Could not resolve vitest.config file" ) ;
1515}
1616
1717export async function test ( ctx : CommandContext ) {
18- const stdio = x ( local ( "vitest" ) , [ "run" , "--config" , resolveConfig ( ) , ...ctx . args ] ) ;
18+ const stdio = x ( local ( "vitest" ) , [ "run" , "--config" , resolveConfig ( ) , ...ctx . args ] ) ;
1919
20- for await ( const line of stdio ) {
21- console . log ( line ) ;
22- }
20+ for await ( const line of stdio ) {
21+ console . log ( line ) ;
22+ }
2323}
0 commit comments