@@ -113,6 +113,7 @@ try {
113113 await server ?. close ( ) . catch ( ( ) => { } ) ;
114114}
115115
116+ /** Parses CLI flags and chooses the default capability enforcement mode. */
116117function parseArguments ( arguments_ : string [ ] ) : RunnerOptions {
117118 const normalizedArguments =
118119 arguments_ [ 0 ] === '--' ? arguments_ . slice ( 1 ) : arguments_ ;
@@ -147,6 +148,7 @@ function parseArguments(arguments_: string[]): RunnerOptions {
147148 } ;
148149}
149150
151+ /** Resolves deduplicated WPT paths and verifies enforced paths are classified. */
150152function selectPaths (
151153 options : RunnerOptions ,
152154 groupedCapabilities : ReadonlyMap < string , readonly CapabilityRow [ ] > ,
@@ -167,6 +169,7 @@ function selectPaths(
167169 return paths ;
168170}
169171
172+ /** Runs one WPT file and converts page evaluation errors into a run record. */
170173async function runWpt (
171174 browserPage : Page ,
172175 testPath : string ,
@@ -189,6 +192,7 @@ async function runWpt(
189192 }
190193}
191194
195+ /** Reports an unclassified run and returns whether any result failed. */
192196function printExploratoryResult ( run : WptRunRecord ) : boolean {
193197 const tests = run . result ?. tests ?? [ ] ;
194198 const failedTests = tests . filter ( ( test ) => test . status !== 0 ) ;
@@ -206,6 +210,7 @@ function printExploratoryResult(run: WptRunRecord): boolean {
206210 return failed ;
207211}
208212
213+ /** Evaluates and reports classified results, drift, and promotion candidates. */
209214function printCapabilityResult (
210215 run : WptRunRecord ,
211216 rows : readonly CapabilityRow [ ] ,
@@ -263,6 +268,7 @@ function printTestFailure(test: WptHarnessTestResult, prefix: string): void {
263268 if ( test . stack ) console . log ( indent ( test . stack , ' ' ) ) ;
264269}
265270
271+ /** Prints a run error and its most recent captured browser logs. */
266272function printRunError ( run : WptRunRecord ) : void {
267273 if ( run . error ) console . log ( indent ( run . error , ' ' ) ) ;
268274 if ( run . state === 'error' && run . logs ?. length > 0 ) {
0 commit comments