From d0debd29cac5ccec21de4cbdfbe59afbd2c12e4d Mon Sep 17 00:00:00 2001 From: Jess Bees Date: Wed, 2 Feb 2022 11:20:34 -0500 Subject: [PATCH] Ignore the SEO json tag, which is inconsistently rendered locally and on actions --- bin/compare_expected_output | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/compare_expected_output b/bin/compare_expected_output index b187911..c2e5328 100755 --- a/bin/compare_expected_output +++ b/bin/compare_expected_output @@ -14,8 +14,10 @@ differences = [] expected_files.each do |expected_file| if actual_files.include?(expected_file) - # TODO: consider -b to ignore whitespace, or -B for ignore blank lines, or --strip-trailing-cr - diff = `diff #{Shellwords.escape(File.join("_expected", expected_file))} #{Shellwords.escape(File.join("_site", expected_file))}` + # FIXME: if we are able to move the expected output recording job onto actions, + # then we will be able to remove the -I param below which ignores the SEO json + # tag, because the recording will be consistent with the test output. + diff = `diff -I '"@context":"https://schema.org"' #{Shellwords.escape(File.join("_expected", expected_file))} #{Shellwords.escape(File.join("_site", expected_file))}` if !$?.success? differences << "Expected output of #{expected_file} differs:\n#{diff}" end