summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorPig Fang <g-plane@hotmail.com>2024-08-10 00:52:23 +0800
committerGitHub <noreply@github.com>2024-08-09 18:52:23 +0200
commit82884348cb1b424a4c4452ef734bc4e760926b2f (patch)
treea64142bb68dc2509dd9ec421a9a88fcec1e6f65e /tests/specs
parent218ee1b1ffebbb53aa82c8ce55e7ee7061342249 (diff)
feat(fmt): support CSS, SCSS, Sass and Less (#24870)
This PR integrates [Malva](https://github.com/g-plane/malva) into `deno fmt`, which introduces the ability to format CSS, SCSS, Sass and Less files. On Linux x64 6.10, this PR increases about 800KiB: ``` ❯ wc -c target/release/deno 125168728 target/release/deno ❯ wc -c target/release/deno 124349456 target/release/deno ```
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/fmt/unstable_css/__test__.jsonc25
-rw-r--r--tests/specs/fmt/unstable_css/badly_formatted.css1
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/specs/fmt/unstable_css/__test__.jsonc b/tests/specs/fmt/unstable_css/__test__.jsonc
new file mode 100644
index 000000000..32259f3ae
--- /dev/null
+++ b/tests/specs/fmt/unstable_css/__test__.jsonc
@@ -0,0 +1,25 @@
+{
+ "tempDir": true,
+ "tests": {
+ "nothing": {
+ "args": "fmt",
+ "output": "Checked 1 file\n"
+ },
+ "flag": {
+ "args": "fmt --unstable-css",
+ "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n"
+ },
+ "config_file": {
+ "steps": [{
+ "args": [
+ "eval",
+ "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-css\"]\\n}\\n')"
+ ],
+ "output": "[WILDCARD]"
+ }, {
+ "args": "fmt",
+ "output": "[WILDLINE]badly_formatted.css\nChecked 2 files\n"
+ }]
+ }
+ }
+}
diff --git a/tests/specs/fmt/unstable_css/badly_formatted.css b/tests/specs/fmt/unstable_css/badly_formatted.css
new file mode 100644
index 000000000..e57adb796
--- /dev/null
+++ b/tests/specs/fmt/unstable_css/badly_formatted.css
@@ -0,0 +1 @@
+#app>.btn{ color : #000 }