Skip to content

Commit

Permalink
re-add css cli tests
Browse files Browse the repository at this point in the history
  • Loading branch information
faultyserver committed Dec 20, 2023
1 parent 23db478 commit 48e0ddd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
16 changes: 6 additions & 10 deletions crates/biome_cli/tests/cases/overrides_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ const UNFORMATTED: &str = " statement( ) ";
const UNFORMATTED_JSON: &str = r#"{ "asta": ["lorem", "ipsum", "first", "second"] }"#;
const FORMATTED_JSON: &str =
"{\n \"asta\": [\n \"lorem\",\n \"ipsum\",\n \"first\",\n \"second\"\n ]\n}\n";
// TODO(faulty): re-add when the CSS formatter is available from the CLI.
// const UNFORMATTED_CSS: &str = "html {}";
// const FORMATTED_CSS: &str = "html {\n}\n";
const UNFORMATTED_CSS: &str = "html {}";
const FORMATTED_CSS: &str = "html {\n}\n";

const UNFORMATTED_LINE_WIDTH: &str = r#"const a = ["loreum", "ipsum"]"#;
const FORMATTED: &str = "statement();\n";
Expand Down Expand Up @@ -321,9 +320,8 @@ fn does_include_file_with_different_languages_and_files() {
let json_file = Path::new("test3.json");
fs.insert(json_file.into(), UNFORMATTED_JSON.as_bytes());

// TODO(faulty): re-add when the CSS formatter is available from the CLI.
// let css_file = Path::new("test4.css");
// fs.insert(css_file.into(), UNFORMATTED_CSS.as_bytes());
let css_file = Path::new("test4.css");
fs.insert(css_file.into(), UNFORMATTED_CSS.as_bytes());

let result = run_cli(
DynRef::Borrowed(&mut fs),
Expand All @@ -335,8 +333,7 @@ fn does_include_file_with_different_languages_and_files() {
test.as_os_str().to_str().unwrap(),
test2.as_os_str().to_str().unwrap(),
json_file.as_os_str().to_str().unwrap(),
// TODO(faulty): re-add when the CSS formatter is available from the CLI.
// css_file.as_os_str().to_str().unwrap(),
css_file.as_os_str().to_str().unwrap(),
]
.as_slice(),
),
Expand All @@ -347,8 +344,7 @@ fn does_include_file_with_different_languages_and_files() {
assert_file_contents(&fs, test, FORMATTED_WITH_SINGLE_QUOTES);
assert_file_contents(&fs, test2, FORMATTED_WITH_NO_SEMICOLONS);
assert_file_contents(&fs, json_file, FORMATTED_JSON);
// TODO(faulty): re-add when the CSS formatter is available from the CLI.
// assert_file_contents(&fs, css_file, FORMATTED_CSS);
assert_file_contents(&fs, css_file, FORMATTED_CSS);

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@ const a = ["loreum", "ipsum"]

```

## `test4.css`

```css
html {
}

```

# Emitted Messages

```block
Formatted 3 file(s) in <TIME>
Formatted 4 file(s) in <TIME>
```


Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ expression: content
## `input.css`

```css
html {}
html {
}

```

## `input.js`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ expression: content
## `input.css`

```css
html {}
html {
}

```

## `input.js`
Expand Down

0 comments on commit 48e0ddd

Please sign in to comment.