Skip to content

Commit c60dbfa

Browse files
committed
Prevent snapshots from picking up old junk
If a previous run of the static site generator created new files, these will be left lying around, even if subsequent runs wouldn't generate that file anymore. This will lead to either a false negative or a false positive. - The file shouldn't be generated and isn't. Tests incorrectly fail because it's still there. - The file should be generated but isn't. Tests incorrectly pass because it's still there.
1 parent 415fac6 commit c60dbfa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ pub fn main() -> eyre::Result<()> {
305305

306306
#[test]
307307
fn snapshot() {
308+
std::fs::remove_dir_all(concat!(env!("CARGO_MANIFEST_DIR"), "/site")).unwrap();
308309
main().unwrap();
309310
let timestamped_files = ["releases.json", "feed.xml"];
310311
let inexplicably_non_deterministic_files = ["images/2023-08-rust-survey-2022/experiences.png"];

0 commit comments

Comments
 (0)