()
| 407 | |
| 408 | const compiler = webpack(options); |
| 409 | const run = () => { |
| 410 | const deprecationTracker = deprecationTracking.start(); |
| 411 | compiler.run((err, _stats) => { |
| 412 | const stats = /** @type {import("../").Stats} */ (_stats); |
| 413 | const deprecations = deprecationTracker(); |
| 414 | if (err) return done(err); |
| 415 | const infrastructureLogErrors = [ |
| 416 | ...filterInfraStructureErrors(infraStructureLog, { |
| 417 | run: 3, |
| 418 | options |
| 419 | }), |
| 420 | ...infraStructureErrors.map((message) => ({ message })) |
| 421 | ]; |
| 422 | if ( |
| 423 | infrastructureLogErrors.length && |
| 424 | checkArrayExpectation( |
| 425 | testDirectory, |
| 426 | { infrastructureLogs: infrastructureLogErrors }, |
| 427 | "infrastructureLog", |
| 428 | "infrastructure-log", |
| 429 | "InfrastructureLog", |
| 430 | options, |
| 431 | done |
| 432 | ) |
| 433 | ) { |
| 434 | return; |
| 435 | } |
| 436 | compiler.close((err) => { |
| 437 | if (err) return done(err); |
| 438 | const statOptions = { |
| 439 | preset: "verbose", |
| 440 | colors: false, |
| 441 | modules: true, |
| 442 | reasonsSpace: 1000 |
| 443 | }; |
| 444 | fs.mkdirSync(outputDirectory, { recursive: true }); |
| 445 | fs.writeFileSync( |
| 446 | path.join(outputDirectory, "stats.txt"), |
| 447 | stats.toString(statOptions), |
| 448 | "utf8" |
| 449 | ); |
| 450 | const jsonStats = stats.toJson({ |
| 451 | errorDetails: true, |
| 452 | modules: false, |
| 453 | assets: false, |
| 454 | chunks: false |
| 455 | }); |
| 456 | if ( |
| 457 | checkArrayExpectation( |
| 458 | testDirectory, |
| 459 | jsonStats, |
| 460 | "error", |
| 461 | "Error", |
| 462 | options, |
| 463 | done |
| 464 | ) |
| 465 | ) { |
| 466 | return; |
no test coverage detected