summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-02 15:52:48 +0200
committerGitHub <noreply@github.com>2024-08-02 13:52:48 +0000
commit0da81205d57e947e82aa02206f8ba6822c624ebc (patch)
tree4472cc6281aca813adc3c2a06321701ea3c3008f /tests/specs
parent2aad92c30b327b9db352e8a2c024671205eed9f6 (diff)
feat(unstable/fmt): move yaml formatting behind unstable flag (#24848)
This moves YAML formatting behind an unstable flag for Deno 1.46. This will make it opt-in to start and then we can remove the flag to make it on by default in version of Deno after that. This can be specified by doing `deno fmt --unstable-yaml` or by specifying the following in a deno.json file: ```json { "unstable": ["fmt-yaml"] } ```
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/fmt/unstable_yaml/__test__.jsonc25
-rw-r--r--tests/specs/fmt/unstable_yaml/badly_formatted.yml3
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/specs/fmt/unstable_yaml/__test__.jsonc b/tests/specs/fmt/unstable_yaml/__test__.jsonc
new file mode 100644
index 000000000..885db59b9
--- /dev/null
+++ b/tests/specs/fmt/unstable_yaml/__test__.jsonc
@@ -0,0 +1,25 @@
+{
+ "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/unstable_yaml/badly_formatted.yml b/tests/specs/fmt/unstable_yaml/badly_formatted.yml
new file mode 100644
index 000000000..49646f320
--- /dev/null
+++ b/tests/specs/fmt/unstable_yaml/badly_formatted.yml
@@ -0,0 +1,3 @@
+- Test
+ - Test
+ - Test \ No newline at end of file