Skip to content

Commit 76dada6

Browse files
pftgclaude
andcommitted
fix: suppress reporter noise in test output
- Move "HTML report:" message from finalize to at_exit hook (only prints when global reporter has failures, not in unit tests) - Gate "Reporter skipped" warn behind ENV["DEBUG"] - Remove verbose error backtrace from at_exit (noise in test output) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b82955a commit 76dada6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • lib/capybara_screenshot_diff/reporters

lib/capybara_screenshot_diff/reporters/html.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def record(assertions)
2828

2929
@failures << failure_entry_for(assertion.name, compare)
3030
rescue => e
31-
warn "[snap_diff] Reporter skipped '#{assertion.name}': #{e.message}"
31+
warn "[snap_diff] Reporter skipped '#{assertion.name}': #{e.message}" if ENV["DEBUG"]
3232
end
3333
end
3434

@@ -37,7 +37,6 @@ def finalize
3737

3838
@finalized = true
3939
write_report
40-
$stdout.puts "[snap_diff] HTML report: #{output_path}"
4140
end
4241

4342
def passed = total - failures.size
@@ -97,8 +96,8 @@ def write_report
9796
at_exit do
9897
CapybaraScreenshotDiff.reporters.each do |reporter|
9998
reporter.finalize
99+
$stdout.puts "[snap_diff] HTML report: #{reporter.output_path}" if reporter.is_a?(CapybaraScreenshotDiff::Reporters::HTML) && !reporter.failures.empty?
100100
rescue => e
101101
warn "[snap_diff] Reporter #{reporter.class} failed (#{e.class}: #{e.message})"
102-
warn e.full_message(highlight: false) if e.respond_to?(:full_message)
103102
end
104103
end

0 commit comments

Comments
 (0)