Skip to content

Commit 229a81f

Browse files
committed
Normalize stderr in callback watch test
Make the callback watch feature test compare stderr semantically by collapsing whitespace before assertions. This avoids brittle failures from formatting differences while keeping the redaction and replay guidance checks intact.
1 parent fb5049b commit 229a81f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tests/Feature/Commands/Callbacks/WatchCallbacksCommandTest.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,19 @@ public function run(
313313
'--to' => 'http://localhost/callback',
314314
], ['capture_stderr_separately' => true]);
315315
$errorOutput = $tester->getErrorOutput();
316+
$semanticErrorOutput = preg_replace('/\s+/', ' ', $errorOutput) ?? $errorOutput;
316317

317318
expect($result)->toBe(1)
318319
->and($tester->getDisplay())->not->toContain('Callback delivery failed')
319-
->and($errorOutput)
320+
->and($semanticErrorOutput)
320321
->toContain('Callback delivery failed for payment 42 operation [redacted]-operation')
321322
->toContain($context)
322323
->toContain('callbacks:replay 42')
323324
->toContain('--to=<corrected-url>')
324325
->not->toContain('watch-api-key');
325326

326327
if ($unexpectedContext !== null) {
327-
expect($errorOutput)->not->toContain($unexpectedContext);
328+
expect($semanticErrorOutput)->not->toContain($unexpectedContext);
328329
}
329330

330331
Http::assertNothingSent();

0 commit comments

Comments
 (0)