summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-09-23 17:01:04 +0100
committerGitHub <noreply@github.com>2024-09-23 18:01:04 +0200
commita7ac89935b092f86245ce0370042f4bef14ad82d (patch)
tree01a3cba6b7f83c65e0318a8e7eef69d46a7f82ed /tests
parentbe13da5d8d08c105e73bc966f681a02b863903d1 (diff)
feat(fmt): stabilize CSS, HTML and YAML formatters (#25753)
This commits stabilizes CSS, HTML and YAML formatters in `deno fmt`. It is no longer required to use either of these flags: - `--unstable-css` - `--unstable-html` - `--unstable-yaml` Or these `unstable` options in the config file: - `fmt-css` - `fmt-html` - `html-yaml`
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/lsp_tests.rs21
-rw-r--r--tests/specs/fmt/css/__test__.jsonc5
-rw-r--r--tests/specs/fmt/css/badly_formatted.css (renamed from tests/specs/fmt/unstable_css/badly_formatted.css)0
-rw-r--r--tests/specs/fmt/html/__test__.jsonc5
-rw-r--r--tests/specs/fmt/html/badly_formatted.html (renamed from tests/specs/fmt/unstable_html/badly_formatted.html)0
-rw-r--r--tests/specs/fmt/unstable_component/__test__.jsonc4
-rw-r--r--tests/specs/fmt/unstable_css/__test__.jsonc25
-rw-r--r--tests/specs/fmt/unstable_html/__test__.jsonc25
-rw-r--r--tests/specs/fmt/unstable_yaml/__test__.jsonc25
-rw-r--r--tests/specs/fmt/yaml/__test__.jsonc5
-rw-r--r--tests/specs/fmt/yaml/badly_formatted.yml (renamed from tests/specs/fmt/unstable_yaml/badly_formatted.yml)0
11 files changed, 17 insertions, 98 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs
index f2c40f8ea..2d8d88b27 100644
--- a/tests/integration/lsp_tests.rs
+++ b/tests/integration/lsp_tests.rs
@@ -10597,13 +10597,6 @@ fn lsp_format_markdown() {
fn lsp_format_html() {
let context = TestContextBuilder::new().use_temp_cwd().build();
let temp_dir = context.temp_dir();
- temp_dir.write(
- "deno.json",
- json!({
- "unstable": ["fmt-html"],
- })
- .to_string(),
- );
let html_file =
source_file(temp_dir.path().join("file.html"), " <html></html>");
let mut client = context.new_lsp_command().build();
@@ -10644,13 +10637,6 @@ fn lsp_format_html() {
fn lsp_format_css() {
let context = TestContextBuilder::new().use_temp_cwd().build();
let temp_dir = context.temp_dir();
- temp_dir.write(
- "deno.json",
- json!({
- "unstable": ["fmt-css"],
- })
- .to_string(),
- );
let css_file = source_file(temp_dir.path().join("file.css"), " foo {}");
let mut client = context.new_lsp_command().build();
client.initialize_default();
@@ -10690,13 +10676,6 @@ fn lsp_format_css() {
fn lsp_format_yaml() {
let context = TestContextBuilder::new().use_temp_cwd().build();
let temp_dir = context.temp_dir();
- temp_dir.write(
- "deno.json",
- json!({
- "unstable": ["fmt-yaml"],
- })
- .to_string(),
- );
let yaml_file = source_file(temp_dir.path().join("file.yaml"), " foo: 1");
let mut client = context.new_lsp_command().build();
client.initialize_default();
diff --git a/tests/specs/fmt/css/__test__.jsonc b/tests/specs/fmt/css/__test__.jsonc
new file mode 100644
index 000000000..e58818fbe
--- /dev/null
+++ b/tests/specs/fmt/css/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "tempDir": true,
+ "args": "fmt",
+ "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n"
+}
diff --git a/tests/specs/fmt/unstable_css/badly_formatted.css b/tests/specs/fmt/css/badly_formatted.css
index e57adb796..e57adb796 100644
--- a/tests/specs/fmt/unstable_css/badly_formatted.css
+++ b/tests/specs/fmt/css/badly_formatted.css
diff --git a/tests/specs/fmt/html/__test__.jsonc b/tests/specs/fmt/html/__test__.jsonc
new file mode 100644
index 000000000..cec29d1b3
--- /dev/null
+++ b/tests/specs/fmt/html/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "tempDir": true,
+ "args": "fmt --unstable-html",
+ "output": "[WILDLINE]badly_formatted.html\nChecked 1 file\n"
+}
diff --git a/tests/specs/fmt/unstable_html/badly_formatted.html b/tests/specs/fmt/html/badly_formatted.html
index de7706ac7..de7706ac7 100644
--- a/tests/specs/fmt/unstable_html/badly_formatted.html
+++ b/tests/specs/fmt/html/badly_formatted.html
diff --git a/tests/specs/fmt/unstable_component/__test__.jsonc b/tests/specs/fmt/unstable_component/__test__.jsonc
index a8f8697da..36057cbef 100644
--- a/tests/specs/fmt/unstable_component/__test__.jsonc
+++ b/tests/specs/fmt/unstable_component/__test__.jsonc
@@ -6,14 +6,14 @@
"output": "Checked 1 file\n"
},
"flag": {
- "args": "fmt --unstable-css --unstable-component",
+ "args": "fmt --unstable-component",
"output": "[WILDLINE]badly_formatted.svelte\nChecked 1 file\n"
},
"config_file": {
"steps": [{
"args": [
"eval",
- "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-css\", \"fmt-component\"]\\n}\\n')"
+ "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-component\"]\\n}\\n')"
],
"output": "[WILDCARD]"
}, {
diff --git a/tests/specs/fmt/unstable_css/__test__.jsonc b/tests/specs/fmt/unstable_css/__test__.jsonc
deleted file mode 100644
index 32259f3ae..000000000
--- a/tests/specs/fmt/unstable_css/__test__.jsonc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "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_html/__test__.jsonc b/tests/specs/fmt/unstable_html/__test__.jsonc
deleted file mode 100644
index 2394805ad..000000000
--- a/tests/specs/fmt/unstable_html/__test__.jsonc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "tempDir": true,
- "tests": {
- "nothing": {
- "args": "fmt",
- "output": "Checked 1 file\n"
- },
- "flag": {
- "args": "fmt --unstable-css --unstable-html",
- "output": "[WILDLINE]badly_formatted.html\nChecked 1 file\n"
- },
- "config_file": {
- "steps": [{
- "args": [
- "eval",
- "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-css\", \"fmt-html\"]\\n}\\n')"
- ],
- "output": "[WILDCARD]"
- }, {
- "args": "fmt",
- "output": "[WILDLINE]badly_formatted.html\nChecked 2 files\n"
- }]
- }
- }
-}
diff --git a/tests/specs/fmt/unstable_yaml/__test__.jsonc b/tests/specs/fmt/unstable_yaml/__test__.jsonc
deleted file mode 100644
index 885db59b9..000000000
--- a/tests/specs/fmt/unstable_yaml/__test__.jsonc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "tempDir": true,
- "tests": {
- "nothing": {
- "args": "fmt",
- "output": "Checked 1 file\n"
- },
- "flag": {
- "args": "fmt --unstable-yaml",
- "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n"
- },
- "config_file": {
- "steps": [{
- "args": [
- "eval",
- "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-yaml\"]\\n}\\n')"
- ],
- "output": "[WILDCARD]"
- }, {
- "args": "fmt",
- "output": "[WILDLINE]badly_formatted.yml\nChecked 2 files\n"
- }]
- }
- }
-} \ No newline at end of file
diff --git a/tests/specs/fmt/yaml/__test__.jsonc b/tests/specs/fmt/yaml/__test__.jsonc
new file mode 100644
index 000000000..3cef276b8
--- /dev/null
+++ b/tests/specs/fmt/yaml/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "tempDir": true,
+ "args": "fmt",
+ "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n"
+} \ No newline at end of file
diff --git a/tests/specs/fmt/unstable_yaml/badly_formatted.yml b/tests/specs/fmt/yaml/badly_formatted.yml
index 49646f320..49646f320 100644
--- a/tests/specs/fmt/unstable_yaml/badly_formatted.yml
+++ b/tests/specs/fmt/yaml/badly_formatted.yml