(
/** @type {Error | null} */ err,
/** @type {import("../").Stats} */ stats
)
| 446 | infraStructureLog.length = 0; |
| 447 | const deprecationTracker = deprecationTracking.start(); |
| 448 | const onCompiled = ( |
| 449 | /** @type {Error | null} */ err, |
| 450 | /** @type {import(class="st">"../").Stats} */ stats |
| 451 | ) => { |
| 452 | const deprecations = deprecationTracker(); |
| 453 | if (err) return handleFatalError(err, done); |
| 454 | const statOptions = { |
| 455 | preset: class="st">"verbose", |
| 456 | colors: false |
| 457 | }; |
| 458 | fs.mkdirSync(outputDirectory, { recursive: true }); |
| 459 | fs.writeFileSync( |
| 460 | path.join(outputDirectory, class="st">"stats.txt"), |
| 461 | stats.toString(statOptions), |
| 462 | class="st">"utf8" |
| 463 | ); |
| 464 | const jsonStats = stats.toJson({ |
| 465 | errorDetails: true |
| 466 | }); |
| 467 | fs.writeFileSync( |
| 468 | path.join(outputDirectory, class="st">"stats.json"), |
| 469 | JSON.stringify(jsonStats, null, 2), |
| 470 | class="st">"utf8" |
| 471 | ); |
| 472 | if ( |
| 473 | checkArrayExpectation( |
| 474 | testDirectory, |
| 475 | jsonStats, |
| 476 | class="st">"error", |
| 477 | class="st">"Error", |
| 478 | options, |
| 479 | done |
| 480 | ) |
| 481 | ) { |
| 482 | return; |
| 483 | } |
| 484 | if ( |
| 485 | checkArrayExpectation( |
| 486 | testDirectory, |
| 487 | jsonStats, |
| 488 | class="st">"warning", |
| 489 | class="st">"Warning", |
| 490 | options, |
| 491 | done |
| 492 | ) |
| 493 | ) { |
| 494 | return; |
| 495 | } |
| 496 | const infrastructureLogging = stderr.toString(); |
| 497 | if (infrastructureLogging) { |
| 498 | return done( |
| 499 | new Error( |
| 500 | `Errors/Warnings during build:\n${infrastructureLogging}` |
| 501 | ) |
| 502 | ); |
| 503 | } |
| 504 | if ( |
| 505 | checkArrayExpectation( |
no test coverage detected