From 0ed9af69e5b4076811543bd8d24db950a2939407 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Mon, 19 Aug 2024 16:53:46 +0530 Subject: [PATCH] chore: handle nanoseconds for better comparison --- bats/e2e.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bats/e2e.bats b/bats/e2e.bats index 5aaf8313..8296330d 100644 --- a/bats/e2e.bats +++ b/bats/e2e.bats @@ -153,5 +153,5 @@ teardown_file() { exec_graphql 'transactions' "$variables" second_ts=$(graphql_output '.data.transactions.nodes[0].createdAt') - [[ $(date -d "$second_ts" +%s) -lt $(date -d "$first_ts" +%s) ]] || exit 1 + [[ $(echo "$(date -d "$second_ts" +%s.%N) < $(date -d "$first_ts" +%s.%N)" | bc -l) -eq 1 ]] || exit 1 }