11import * as assert from "node:assert" ;
22import { setup } from "#dev/process" ;
33
4- const { execBuildLegacy , execCleanLegacy } = setup ( import . meta. dirname ) ;
4+ const { execBuild , execClean } = setup ( import . meta. dirname ) ;
55
6- const o1 = await execBuildLegacy ( ) ;
6+ const o1 = await execBuild ( ) ;
77
8- const first_message = o1 . stdout
8+ // biome-ignore lint/suspicious/noControlCharactersInRegex: strip ANSI color codes from output
9+ const stripAnsi = s => s . replace ( / \x1b \[ [ 0 - 9 ; ] * m / g, "" ) ;
10+
11+ const first_message = stripAnsi ( o1 . stdout )
912 . split ( "\n" )
1013 . map ( s => s . trim ( ) )
1114 . find ( s => s === "Warning number 110" ) ;
@@ -14,10 +17,10 @@ if (!first_message) {
1417 assert . fail ( o1 . stdout ) ;
1518}
1619
17- // Second build using -warn-error +110
18- const o2 = await execBuildLegacy ( [ "-warn-error" , "+110" ] ) ;
20+ // Second build using -- warn-error +110
21+ const o2 = await execBuild ( [ "- -warn-error" , "+110" ] ) ;
1922
20- const second_message = o2 . stdout
23+ const second_message = stripAnsi ( o2 . stdout )
2124 . split ( "\n" )
2225 . map ( s => s . trim ( ) )
2326 . find ( s => s === "Warning number 110 (configured as error)" ) ;
@@ -26,17 +29,17 @@ if (!second_message) {
2629 assert . fail ( o2 . stdout ) ;
2730}
2831
29- // Third build, without -warn-error +110
32+ // Third build, without -- warn-error +110
3033// The result should not be a warning as error
31- const o3 = await execBuildLegacy ( ) ;
34+ const o3 = await execBuild ( ) ;
3235
33- const third_message = o3 . stdout
36+ const third_message = stripAnsi ( o3 . stdout )
3437 . split ( "\n" )
3538 . map ( s => s . trim ( ) )
36- . find ( s => s === "Dependency Finished " ) ;
39+ . find ( s => s === "Warning number 110 (configured as error) " ) ;
3740
38- if ( ! third_message ) {
41+ if ( o3 . status !== 0 || third_message ) {
3942 assert . fail ( o3 . stdout ) ;
4043}
4144
42- await execCleanLegacy ( ) ;
45+ await execClean ( ) ;
0 commit comments