Skip to content

Commit

Permalink
☔ More workarounds in the unit tests for Facebook's non-deterministic…
Browse files Browse the repository at this point in the history
… behaviour
  • Loading branch information
pmonks committed Nov 12, 2024
1 parent a4f14ca commit 697b22b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unfurl/api_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
(is (true? (s/includes? (s/lower-case (:title result)) "facebook")))
(is (not (s/blank? (:description result))))
(is (true? (s/includes? (:url result) "https://www.facebook.com/")))
(is (true? (s/includes? (:preview-url result) "https://www.facebook.com/images/"))))
(is (true? (or (nil? (:preview-url result)) ; Because Facebook (unpredictably) does not return a preview URL in some cases 🙄
(s/includes? (:preview-url result) "https://www.facebook.com/images/")))))

; Everything and the kitchen sink tags (OpenGraph, Twitter, Swiftype and Sailthru!)
; Commented out as TechCrunch web server's aren't reliable enough to use for unit testing - sometimes they work, sometimes they time out, sometimes they return a corrupted ZLIB stream, ...
Expand Down

0 comments on commit 697b22b

Please sign in to comment.