diff --git a/crates/rome_cli/tests/commands/check.rs b/crates/rome_cli/tests/commands/check.rs index 1817f2c3110..14333f57db5 100644 --- a/crates/rome_cli/tests/commands/check.rs +++ b/crates/rome_cli/tests/commands/check.rs @@ -2274,6 +2274,38 @@ if (true) { )); } +#[test] +fn apply_bogus_argument() { + let mut fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + + let file_path = Path::new("fix.js"); + fs.insert( + file_path.into(), + "function _13_1_3_fun(arguments) { }".as_bytes(), + ); + + let result = run_cli( + DynRef::Borrowed(&mut fs), + &mut console, + Args::from(&[ + ("check"), + file_path.as_os_str().to_str().unwrap(), + ("--apply-unsafe"), + ]), + ); + + assert!(result.is_ok(), "run_cli returned {result:?}"); + + assert_cli_snapshot(SnapshotPayload::new( + module_path!(), + "apply_bogus_argument", + fs, + console, + result, + )); +} + #[test] fn ignores_unknown_file() { let mut fs = MemoryFileSystem::default(); diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/apply_bogus_argument.snap b/crates/rome_cli/tests/snapshots/main_commands_check/apply_bogus_argument.snap new file mode 100644 index 00000000000..f5dd858ad26 --- /dev/null +++ b/crates/rome_cli/tests/snapshots/main_commands_check/apply_bogus_argument.snap @@ -0,0 +1,18 @@ +--- +source: crates/rome_cli/tests/snap_test.rs +expression: content +--- +## `fix.js` + +```js +function _13_1_3_fun(arguments) { } + +``` + +# Emitted Messages + +```block +Fixed 1 file(s) in