feat: add fetched-at timestamp to markdown header and json meta
This commit is contained in:
@@ -13,6 +13,7 @@ fn render_md_reads_json_and_outputs_markdown_to_stdout() {
|
||||
"pr_index": 1,
|
||||
"title": "t",
|
||||
"description": "PR body",
|
||||
"fetched_at": "2026-04-08T12:34:56Z",
|
||||
"state": "open",
|
||||
"author": "a",
|
||||
"base_branch": "main",
|
||||
@@ -56,6 +57,7 @@ fn render_md_writes_to_out_file_when_requested() {
|
||||
"pr_index": 2,
|
||||
"title": "t2",
|
||||
"description": "PR body",
|
||||
"fetched_at": "2026-04-08T12:34:56Z",
|
||||
"state": "open",
|
||||
"author": "a",
|
||||
"base_branch": "main",
|
||||
@@ -220,6 +222,7 @@ fn fetch_writes_markdown_to_stdout_by_default() {
|
||||
|
||||
let stdout = String::from_utf8(assert.get_output().stdout.clone()).unwrap();
|
||||
assert!(stdout.contains("# org/repo `#7` Fix parser"));
|
||||
assert!(stdout.contains("> fetched at: "));
|
||||
assert!(stdout.contains("## Commits"));
|
||||
assert!(stdout.contains("## Diff Stat"));
|
||||
assert!(stdout.contains("## Review 7.1 (COMMENT)"));
|
||||
@@ -288,5 +291,6 @@ fn fetch_writes_json_to_out_file_when_requested() {
|
||||
let written = std::fs::read_to_string(output.path()).unwrap();
|
||||
assert!(written.contains("\"repo\": \"org/repo\""));
|
||||
assert!(written.contains("\"pr_index\": 8"));
|
||||
assert!(written.contains("\"fetched_at\":"));
|
||||
assert!(written.contains("\"head_branch\": \"feature/y\""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user