Skip to content

Commit

Permalink
test: add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Nov 23, 2024
1 parent 0266d54 commit efe2e8a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/typos-cli/src/bin/typos-cli/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ impl PrintSarif {

run_builder.invocations(invocations.unwrap());
}

let run = run_builder.build()?;
sarif_builder.runs(vec![run]);

let sarif = sarif_builder.build()?;

Expand Down
46 changes: 46 additions & 0 deletions crates/typos-cli/tests/cmd/stdin-failure-sarif.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
bin.name = "typos"
args = "--format sarif -"
status.code = 2
stdin = '''
Apropriate world
'''
stdout = """
{
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
"runs": [
{
"columnKind": "utf16CodeUnits",
"results": [
{
"level": "error",
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "-"
},
"region": {
"endColumn": 11,
"endLine": 1,
"startColumn": 1,
"startLine": 1
}
}
}
],
"message": {
"markdown": "`Apropriate` should be `Appropriate`"
}
}
],
"tool": {
"driver": {
"informationUri": "https://github.com/crate-ci/typos",
"name": "typos"
}
}
}
],
"version": "2.1.0"
}"""
stderr = ""

0 comments on commit efe2e8a

Please sign in to comment.