Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/biome_cli/tests/cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mod protected_files;
mod reporter_checkstyle;
mod reporter_github;
mod reporter_gitlab;
mod reporter_json;
mod reporter_junit;
mod reporter_rdjson;
mod reporter_summary;
Expand Down
83 changes: 83 additions & 0 deletions crates/biome_cli/tests/cases/reporter_json.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
use crate::run_cli;
use crate::snap_test::{SnapshotPayload, assert_cli_snapshot};
use biome_console::BufferConsole;
use biome_fs::MemoryFileSystem;
use bpaf::Args;
use camino::Utf8Path;

const MAIN_1: &str = r#"import { z} from "z"
import { z, b , a} from "lodash"

a ==b
a ==b
a ==b
a ==b

debugger
debugger
debugger
debugger

let f;
let f;
let f;
let f;
let f;
let f;"#;

const MAIN_2: &str = r#"import { z} from "z"
import { z, b , a} from "lodash"

a ==b
a ==b
a ==b
a ==b

debugger
debugger
debugger
debugger

let f;
let f;
let f;
let f;
let f;
let f;"#;

#[ignore]
#[test]
fn reports_diagnostics_json_pretty_lint_command() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let file_path1 = Utf8Path::new("main.ts");
fs.insert(file_path1.into(), MAIN_1.as_bytes());

let file_path2 = Utf8Path::new("index.ts");
fs.insert(file_path2.into(), MAIN_2.as_bytes());

let (fs, result) = run_cli(
fs,
&mut console,
Args::from(
[
"lint",
"--reporter=json-pretty",
file_path1.as_str(),
file_path2.as_str(),
]
.as_slice(),
),
);

assert!(result.is_err(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"reports_diagnostics_json_pretty_lint_command",
fs,
console,
result,
));
}
Loading
Loading