From b8b0320d2d271bb10053403092833a26e57134d1 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Tue, 27 Dec 2022 20:53:35 +0000 Subject: [PATCH] Use ISO time for snapshot tests Fixes tests failing after enough time has passed. ref: https://github.com/o2sh/onefetch/pull/904#issuecomment-1365788241 --- tests/repo.rs | 1 + tests/snapshots/repo__repo.snap | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/repo.rs b/tests/repo.rs index 545132632..86b54764c 100644 --- a/tests/repo.rs +++ b/tests/repo.rs @@ -27,6 +27,7 @@ fn test_repo() -> Result<()> { let repo = repo("repo.sh")?; let config: Config = Config { input: repo.path().to_path_buf(), + iso_time: true, ..Default::default() }; let info = Info::new(&config)?; diff --git a/tests/snapshots/repo__repo.snap b/tests/snapshots/repo__repo.snap index c3939574a..18e65b01e 100644 --- a/tests/snapshots/repo__repo.snap +++ b/tests/snapshots/repo__repo.snap @@ -18,7 +18,7 @@ expression: info ] }, "version": "tag1", - "created": "22 years ago", + "created": "2000-01-02T00:00:00Z", "languages": [ { "language": "Rust", @@ -46,7 +46,7 @@ expression: info "contribution": 25 } ], - "lastChange": "22 years ago", + "lastChange": "2000-01-02T00:00:00Z", "contributors": 4, "repoUrl": "https://github.com/user/repo.git", "numberOfCommits": 4,