Skip to content

Commit 5e4f8b1

Browse files
pftgclaude
andcommitted
fix: reset fail_if_new in test setup for CI compatibility
Tests create new screenshots without baselines, so fail_if_new must be false during test runs. The new CI-aware default (ENV['CI']) would otherwise break all tests that capture new screenshots. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 786a0c1 commit 5e4f8b1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/test_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ class ActiveSupport::TestCase
3939
# Set up fixtures and test helpers
4040
self.file_fixture_path = Pathname.new(File.expand_path("fixtures", __dir__))
4141

42+
setup do
43+
# Tests create new screenshots — don't fail on missing baselines
44+
@_orig_fail_if_new = Capybara::Screenshot::Diff.fail_if_new
45+
Capybara::Screenshot::Diff.fail_if_new = false
46+
end
47+
4248
teardown do
49+
Capybara::Screenshot::Diff.fail_if_new = @_orig_fail_if_new
4350
CapybaraScreenshotDiff::SnapManager.cleanup! unless persist_comparisons?
4451
end
4552

0 commit comments

Comments
 (0)