summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/fmt
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/fmt')
-rw-r--r--cli/tests/testdata/fmt/badly_formatted.json12
-rw-r--r--cli/tests/testdata/fmt/badly_formatted.md46
-rw-r--r--cli/tests/testdata/fmt/badly_formatted.mjs4
-rw-r--r--cli/tests/testdata/fmt/badly_formatted_fixed.js2
-rw-r--r--cli/tests/testdata/fmt/badly_formatted_fixed.json8
-rw-r--r--cli/tests/testdata/fmt/badly_formatted_fixed.md37
-rw-r--r--cli/tests/testdata/fmt/with_config/subdir/a.ts2
-rw-r--r--cli/tests/testdata/fmt/with_config/subdir/b.ts4
8 files changed, 112 insertions, 3 deletions
diff --git a/cli/tests/testdata/fmt/badly_formatted.json b/cli/tests/testdata/fmt/badly_formatted.json
new file mode 100644
index 000000000..f2bacf73d
--- /dev/null
+++ b/cli/tests/testdata/fmt/badly_formatted.json
@@ -0,0 +1,12 @@
+{
+
+
+ "key1": "value1",
+ "key2": true,
+ "key3": ["value2", "value3", false],
+ "keys": {
+ "more": "values"
+ }
+
+
+} \ No newline at end of file
diff --git a/cli/tests/testdata/fmt/badly_formatted.md b/cli/tests/testdata/fmt/badly_formatted.md
new file mode 100644
index 000000000..26afe483b
--- /dev/null
+++ b/cli/tests/testdata/fmt/badly_formatted.md
@@ -0,0 +1,46 @@
+# Hello Markdown
+
+```js
+console.log("Hello World"
+
+)
+```
+
+```javascript
+console.log("Hello World2"
+
+)
+```
+
+```ts
+
+function hello(name: string ) {
+ console.log(name);
+};
+
+hello( "alice");
+```
+
+```typescript
+function foo(): number {
+ return 2;
+}
+```
+
+```jsonc
+
+{
+ // Comment in JSON
+ "key": "value",
+ "key2":
+ "value2",
+}
+
+```
+
+```json
+{
+ "numbers":
+ ["1", "2"]
+}
+``` \ No newline at end of file
diff --git a/cli/tests/testdata/fmt/badly_formatted.mjs b/cli/tests/testdata/fmt/badly_formatted.mjs
new file mode 100644
index 000000000..bc515a330
--- /dev/null
+++ b/cli/tests/testdata/fmt/badly_formatted.mjs
@@ -0,0 +1,4 @@
+// Deliberately using .mjs to avoid triggering dprint
+console.log("Hello World"
+
+)
diff --git a/cli/tests/testdata/fmt/badly_formatted_fixed.js b/cli/tests/testdata/fmt/badly_formatted_fixed.js
new file mode 100644
index 000000000..e9062ba85
--- /dev/null
+++ b/cli/tests/testdata/fmt/badly_formatted_fixed.js
@@ -0,0 +1,2 @@
+// Deliberately using .mjs to avoid triggering dprint
+console.log("Hello World");
diff --git a/cli/tests/testdata/fmt/badly_formatted_fixed.json b/cli/tests/testdata/fmt/badly_formatted_fixed.json
new file mode 100644
index 000000000..0d697a2c6
--- /dev/null
+++ b/cli/tests/testdata/fmt/badly_formatted_fixed.json
@@ -0,0 +1,8 @@
+{
+ "key1": "value1",
+ "key2": true,
+ "key3": ["value2", "value3", false],
+ "keys": {
+ "more": "values"
+ }
+}
diff --git a/cli/tests/testdata/fmt/badly_formatted_fixed.md b/cli/tests/testdata/fmt/badly_formatted_fixed.md
new file mode 100644
index 000000000..8ba74cac3
--- /dev/null
+++ b/cli/tests/testdata/fmt/badly_formatted_fixed.md
@@ -0,0 +1,37 @@
+# Hello Markdown
+
+```js
+console.log("Hello World");
+```
+
+```javascript
+console.log("Hello World2");
+```
+
+```ts
+function hello(name: string) {
+ console.log(name);
+}
+
+hello("alice");
+```
+
+```typescript
+function foo(): number {
+ return 2;
+}
+```
+
+```jsonc
+{
+ // Comment in JSON
+ "key": "value",
+ "key2": "value2"
+}
+```
+
+```json
+{
+ "numbers": ["1", "2"]
+}
+```
diff --git a/cli/tests/testdata/fmt/with_config/subdir/a.ts b/cli/tests/testdata/fmt/with_config/subdir/a.ts
index 50db0d2e1..4baf8d485 100644
--- a/cli/tests/testdata/fmt/with_config/subdir/a.ts
+++ b/cli/tests/testdata/fmt/with_config/subdir/a.ts
@@ -3,7 +3,7 @@ Deno.test(
async function responseClone() {
const response =
await fetch(
- 'http://localhost:4545/fixture.json',
+ 'http://localhost:4545/assets/fixture.json',
);
const response1 =
response.clone();
diff --git a/cli/tests/testdata/fmt/with_config/subdir/b.ts b/cli/tests/testdata/fmt/with_config/subdir/b.ts
index 840198d89..d7eb08b09 100644
--- a/cli/tests/testdata/fmt/with_config/subdir/b.ts
+++ b/cli/tests/testdata/fmt/with_config/subdir/b.ts
@@ -3,10 +3,10 @@ Deno.test(
{ perms: { net: true } },
async function fetchBodyUsedCancelStream() {
const response = await fetch(
- "http://localhost:4545/fixture.json",
+ "http://localhost:4545/assets/fixture.json",
);
assert(response.body !== null);
-
+
assertEquals(response.bodyUsed, false);
const promise = response.body.cancel();
assertEquals(response.bodyUsed, true);