diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-09-24 14:54:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-24 15:54:48 +0200 |
| commit | 3242550f5f0b33769a4e0a24a7dc96773647ca75 (patch) | |
| tree | 3ca7a167c4ed833310f2c396073548cd5181aa5b /tests/specs/fmt/css/__test__.jsonc | |
| parent | 7d7e54172477203f50e553304b0980e17b5fd441 (diff) | |
fix(fmt): --check was broken for CSS, YAML and HTML (#25848)
`deno fmt --check` was broken for CSS, YAML and HTML files.
Before this PR, formatting any of these file types would return a
string, even though the contract in `cli/tools/fmt.rs` is to only return a
string if the formatting changed. This causes wrong flagging of these files
as being badly formatted even though diffs showed nothing (because
they were in fact formatted properly).
Closes https://github.com/denoland/deno/issues/25840
Diffstat (limited to 'tests/specs/fmt/css/__test__.jsonc')
| -rw-r--r-- | tests/specs/fmt/css/__test__.jsonc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/specs/fmt/css/__test__.jsonc b/tests/specs/fmt/css/__test__.jsonc index e58818fbe..a3ded6d43 100644 --- a/tests/specs/fmt/css/__test__.jsonc +++ b/tests/specs/fmt/css/__test__.jsonc @@ -1,5 +1,13 @@ { "tempDir": true, - "args": "fmt", - "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n" + "tests": { + "badly_formatted": { + "args": "fmt badly_formatted.css", + "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n" + }, + "well_formatted": { + "args": "fmt --check well_formatted.css", + "output": "Checked 1 file\n" + } + } } |
