diff --git a/crates/biome_cli/tests/commands/format.rs b/crates/biome_cli/tests/commands/format.rs index 28220f84b9d4..8a532cb02536 100644 --- a/crates/biome_cli/tests/commands/format.rs +++ b/crates/biome_cli/tests/commands/format.rs @@ -591,6 +591,42 @@ fn applies_custom_quote_style() { let file_path = Path::new("file.js"); fs.insert(file_path.into(), APPLY_QUOTE_STYLE_BEFORE.as_bytes()); + + let result = run_cli( + DynRef::Borrowed(&mut fs), + &mut console, + Args::from( + [ + ("format"), + ("--quote-style"), + ("single"), + ("--quote-properties"), + ("preserve"), + ("--write"), + file_path.as_os_str().to_str().unwrap(), + ] + .as_slice(), + ), + ); + + assert!(result.is_ok(), "run_cli returned {result:?}"); + + assert_file_contents(&fs, file_path, APPLY_QUOTE_STYLE_AFTER); + + assert_cli_snapshot(SnapshotPayload::new( + module_path!(), + "applies_custom_quote_style", + fs, + console, + result, + )); +} + +#[test] +fn applies_custom_css_quote_style() { + let mut fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + let css_file_path = Path::new("file.css"); fs.insert( css_file_path.into(), @@ -603,12 +639,9 @@ fn applies_custom_quote_style() { Args::from( [ ("format"), - ("--quote-style"), + ("--css-formatter-quote-style"), ("single"), - ("--quote-properties"), - ("preserve"), ("--write"), - file_path.as_os_str().to_str().unwrap(), css_file_path.as_os_str().to_str().unwrap(), ] .as_slice(), @@ -617,12 +650,11 @@ fn applies_custom_quote_style() { assert!(result.is_ok(), "run_cli returned {result:?}"); - assert_file_contents(&fs, file_path, APPLY_QUOTE_STYLE_AFTER); assert_file_contents(&fs, css_file_path, APPLY_CSS_QUOTE_STYLE_AFTER); assert_cli_snapshot(SnapshotPayload::new( module_path!(), - "applies_custom_quote_style", + "applies_custom_css_quote_style", fs, console, result, diff --git a/crates/biome_cli/tests/snapshots/main_cases_overrides_formatter/does_include_file_with_different_languages.snap b/crates/biome_cli/tests/snapshots/main_cases_overrides_formatter/does_include_file_with_different_languages.snap index 8ae59cc282db..cfef3d31aec1 100644 --- a/crates/biome_cli/tests/snapshots/main_cases_overrides_formatter/does_include_file_with_different_languages.snap +++ b/crates/biome_cli/tests/snapshots/main_cases_overrides_formatter/does_include_file_with_different_languages.snap @@ -16,11 +16,25 @@ expression: content "include": ["test2.js"], "formatter": { "lineWidth": 120, "indentStyle": "space" }, "javascript": { "formatter": { "semicolons": "asNeeded" } } + }, + { + "include": ["test.css"], + "formatter": { "lineWidth": 120, "indentStyle": "space" }, + "css": { "formatter": { "quoteStyle": "single" } } } ] } ``` +## `test.css` + +```css +[class='foo'] { + background-image: url('/path/to/file.jpg'); +} + +``` + ## `test.js` ```js @@ -38,7 +52,7 @@ const a = ["loreum", "ipsum"] # Emitted Messages ```block -Formatted 2 file(s) in