Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
don't compare sent_at if null
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed May 2, 2024
1 parent d66d587 commit d42d047
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion capture/tests/django_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> {
if let Some(object) = expected.as_object_mut() {
// site_url is unused in the pipeline now, let's drop it
object.remove("site_url");

// Remove sent_at field if empty: Rust will skip marshalling it
if let Some(None) = object.get("sent_at").map(|v| v.as_str()) {
object.remove("sent_at");
}
}

let match_config = assert_json_diff::Config::new(assert_json_diff::CompareMode::Strict);
Expand All @@ -209,7 +214,7 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> {
{
println!(
"record mismatch at line {}, event {}: {}",
line_number, event_number, e
line_number+1, event_number, e
);
mismatches += 1;
}
Expand Down

0 comments on commit d42d047

Please sign in to comment.