@@ -4,30 +4,30 @@ import * as assert from "node:assert";
44import { setup } from "#dev/process" ;
55import { normalizeNewlines } from "#dev/utils" ;
66
7- const { rescriptLegacy } = setup ( import . meta. dirname ) ;
7+ const { rescript } = setup ( import . meta. dirname ) ;
88
9- // Shows compile time for `rescript build` command
10- let out = await rescriptLegacy ( "build" ) ;
9+ // Shows build output for `rescript build` command
10+ let out = await rescript ( "build" ) ;
11+ // Timing text only appears with TTY/progress output; plain output omits it.
1112assert . match (
1213 normalizeNewlines ( out . stdout ) ,
13- / > > > > S t a r t c o m p i l i n g \n D e p e n d e n c y F i n i s h e d \n > > > > F i n i s h c o m p i l i n g \d + m s e c o n d s / ,
14+ / P a r s e d \d + s o u r c e f i l e s ( i n [ 0 - 9 . ] + s ) ? / ,
1415) ;
15-
16- // Shows compile time for `rescript` command
17- out = await rescriptLegacy ( "build" ) ;
1816assert . match (
1917 normalizeNewlines ( out . stdout ) ,
20- / > > > > S t a r t c o m p i l i n g \n D e p e n d e n c y F i n i s h e d \n > > > > F i n i s h c o m p i l i n g \d + m s e c o n d s / ,
18+ / C o m p i l e d \d + m o d u l e s ( i n [ 0 - 9 . ] + s ) ? / ,
2119) ;
2220
23- // Doesn't show compile time for `rescript build -verbose ` command
24- // Because we can't be sure that -verbose is a valid argument
25- // And bsb won't fail with a usage message.
26- // It works this way not only for -verbose, but any other arg, including -h/--help/-help
27- out = await rescriptLegacy ( "build" , [ "-verbose" ] ) ;
28-
21+ // Shows build output for `rescript` command
22+ out = await rescript ( "" ) ;
23+ assert . match (
24+ normalizeNewlines ( out . stdout ) ,
25+ / P a r s e d \d + s o u r c e f i l e s ( i n [ 0 - 9 . ] + s ) ? / ,
26+ ) ;
2927assert . match (
3028 normalizeNewlines ( out . stdout ) ,
31- / P a c k a g e s t a c k : t e s t { 2 } \n D e p e n d e n c y F i n i s h e d \n / ,
29+ / C o m p i l e d \d + m o d u l e s ( i n [ 0 - 9 . ] + s ) ? / ,
3230) ;
33- assert . match ( normalizeNewlines ( out . stdout ) , / n i n j a .e x e " ? - C l i b [ \\ / ] b s ? \n / ) ;
31+
32+ out = await rescript ( "build" , [ "-v" ] ) ;
33+ assert . match ( normalizeNewlines ( out . stdout ) , / C r e a t e d p r o j e c t c o n t e x t / ) ;
0 commit comments