Skip to content

Commit

Permalink
Fix markdown_link_check test
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Dec 17, 2023
1 parent 3024764 commit 2c31eee
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cargo-dylint/tests/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,25 @@ fn markdown_link_check() {

let path_buf = Path::new(env!("CARGO_MANIFEST_DIR")).join("..").join(path);

Command::new("npx")
let assert = Command::new("npx")
.args([
"markdown-link-check",
"--config",
&config.to_string_lossy(),
&path_buf.to_string_lossy(),
])
.current_dir(&tempdir)
.assert()
.success();
.assert();
let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap();

assert!(
stdout
.lines()
.skip_while(|line| !line.ends_with(" links checked."))
.skip(1)
.all(|line| { line.is_empty() || line.ends_with(" → Status: 500") }),
"{stdout}"
);
}
}

Expand Down

0 comments on commit 2c31eee

Please sign in to comment.