summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/import_assertions/dynamic_import.ts3
-rw-r--r--cli/tests/testdata/import_assertions/static_import.ts3
-rw-r--r--cli/tests/testdata/import_assertions/type_check.out5
-rw-r--r--cli/tests/testdata/import_assertions/type_check.ts3
-rw-r--r--cli/tests/testdata/import_attributes/data.json (renamed from cli/tests/testdata/import_assertions/data.json)0
-rw-r--r--cli/tests/testdata/import_attributes/dynamic_error.out (renamed from cli/tests/testdata/import_assertions/dynamic_error.out)0
-rw-r--r--cli/tests/testdata/import_attributes/dynamic_error.ts (renamed from cli/tests/testdata/import_assertions/dynamic_error.ts)0
-rw-r--r--cli/tests/testdata/import_attributes/dynamic_import.out (renamed from cli/tests/testdata/import_assertions/dynamic_import.out)1
-rw-r--r--cli/tests/testdata/import_attributes/dynamic_import.ts5
-rw-r--r--cli/tests/testdata/import_attributes/json_with_shebang.json (renamed from cli/tests/testdata/import_assertions/json_with_shebang.json)0
-rw-r--r--cli/tests/testdata/import_attributes/json_with_shebang.ts (renamed from cli/tests/testdata/import_assertions/json_with_shebang.ts)0
-rw-r--r--cli/tests/testdata/import_attributes/json_with_shebang.ts.out (renamed from cli/tests/testdata/import_assertions/json_with_shebang.ts.out)0
-rw-r--r--cli/tests/testdata/import_attributes/static_error.out (renamed from cli/tests/testdata/import_assertions/static_error.out)2
-rw-r--r--cli/tests/testdata/import_attributes/static_error.ts (renamed from cli/tests/testdata/import_assertions/static_error.ts)0
-rw-r--r--cli/tests/testdata/import_attributes/static_export.out (renamed from cli/tests/testdata/import_assertions/static_export.out)0
-rw-r--r--cli/tests/testdata/import_attributes/static_export.ts (renamed from cli/tests/testdata/import_assertions/static_export.ts)0
-rw-r--r--cli/tests/testdata/import_attributes/static_import.out (renamed from cli/tests/testdata/import_assertions/static_import.out)1
-rw-r--r--cli/tests/testdata/import_attributes/static_import.ts5
-rw-r--r--cli/tests/testdata/import_attributes/static_reexport.ts (renamed from cli/tests/testdata/import_assertions/static_reexport.ts)0
-rw-r--r--cli/tests/testdata/import_attributes/type_check.out12
-rw-r--r--cli/tests/testdata/import_attributes/type_check.ts5
-rw-r--r--cli/tests/testdata/run/020_json_modules.ts.out2
22 files changed, 31 insertions, 16 deletions
diff --git a/cli/tests/testdata/import_assertions/dynamic_import.ts b/cli/tests/testdata/import_assertions/dynamic_import.ts
deleted file mode 100644
index d6983852c..000000000
--- a/cli/tests/testdata/import_assertions/dynamic_import.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-const data = await import("./data.json", { assert: { type: "json" } });
-
-console.log(data);
diff --git a/cli/tests/testdata/import_assertions/static_import.ts b/cli/tests/testdata/import_assertions/static_import.ts
deleted file mode 100644
index 180ab75f2..000000000
--- a/cli/tests/testdata/import_assertions/static_import.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import data from "./data.json" assert { type: "json" };
-
-console.log(data);
diff --git a/cli/tests/testdata/import_assertions/type_check.out b/cli/tests/testdata/import_assertions/type_check.out
deleted file mode 100644
index 8e1387456..000000000
--- a/cli/tests/testdata/import_assertions/type_check.out
+++ /dev/null
@@ -1,5 +0,0 @@
-[WILDCARD]
-error: TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'.
-console.log(data.foo);
- ~~~
- at [WILDCARD]type_check.ts:3:18
diff --git a/cli/tests/testdata/import_assertions/type_check.ts b/cli/tests/testdata/import_assertions/type_check.ts
deleted file mode 100644
index 19adb3eae..000000000
--- a/cli/tests/testdata/import_assertions/type_check.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import data from "./data.json" assert { type: "json" };
-
-console.log(data.foo);
diff --git a/cli/tests/testdata/import_assertions/data.json b/cli/tests/testdata/import_attributes/data.json
index 37b3ee1e0..37b3ee1e0 100644
--- a/cli/tests/testdata/import_assertions/data.json
+++ b/cli/tests/testdata/import_attributes/data.json
diff --git a/cli/tests/testdata/import_assertions/dynamic_error.out b/cli/tests/testdata/import_attributes/dynamic_error.out
index 927eae0b8..927eae0b8 100644
--- a/cli/tests/testdata/import_assertions/dynamic_error.out
+++ b/cli/tests/testdata/import_attributes/dynamic_error.out
diff --git a/cli/tests/testdata/import_assertions/dynamic_error.ts b/cli/tests/testdata/import_attributes/dynamic_error.ts
index 2d9c6757f..2d9c6757f 100644
--- a/cli/tests/testdata/import_assertions/dynamic_error.ts
+++ b/cli/tests/testdata/import_attributes/dynamic_error.ts
diff --git a/cli/tests/testdata/import_assertions/dynamic_import.out b/cli/tests/testdata/import_attributes/dynamic_import.out
index 7a7b4c91f..01bc76c8a 100644
--- a/cli/tests/testdata/import_assertions/dynamic_import.out
+++ b/cli/tests/testdata/import_attributes/dynamic_import.out
@@ -1,2 +1,3 @@
[WILDCARD]
[Module: null prototype] { default: { a: "b", c: { d: 10 } } }
+[Module: null prototype] { default: { a: "b", c: { d: 10 } } }
diff --git a/cli/tests/testdata/import_attributes/dynamic_import.ts b/cli/tests/testdata/import_attributes/dynamic_import.ts
new file mode 100644
index 000000000..73f348697
--- /dev/null
+++ b/cli/tests/testdata/import_attributes/dynamic_import.ts
@@ -0,0 +1,5 @@
+const data1 = await import("./data.json", { with: { type: "json" } });
+const data2 = await import("./data.json", { assert: { type: "json" } });
+
+console.log(data1);
+console.log(data2);
diff --git a/cli/tests/testdata/import_assertions/json_with_shebang.json b/cli/tests/testdata/import_attributes/json_with_shebang.json
index b695e4457..b695e4457 100644
--- a/cli/tests/testdata/import_assertions/json_with_shebang.json
+++ b/cli/tests/testdata/import_attributes/json_with_shebang.json
diff --git a/cli/tests/testdata/import_assertions/json_with_shebang.ts b/cli/tests/testdata/import_attributes/json_with_shebang.ts
index 523bf8772..523bf8772 100644
--- a/cli/tests/testdata/import_assertions/json_with_shebang.ts
+++ b/cli/tests/testdata/import_attributes/json_with_shebang.ts
diff --git a/cli/tests/testdata/import_assertions/json_with_shebang.ts.out b/cli/tests/testdata/import_attributes/json_with_shebang.ts.out
index 23eb03720..23eb03720 100644
--- a/cli/tests/testdata/import_assertions/json_with_shebang.ts.out
+++ b/cli/tests/testdata/import_attributes/json_with_shebang.ts.out
diff --git a/cli/tests/testdata/import_assertions/static_error.out b/cli/tests/testdata/import_attributes/static_error.out
index 4efdf8682..171ae0c1a 100644
--- a/cli/tests/testdata/import_assertions/static_error.out
+++ b/cli/tests/testdata/import_attributes/static_error.out
@@ -1,4 +1,4 @@
[WILDCARD]
-error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import assertion with the type of "json".
+error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json".
Specifier: [WILDCARD]/data.json
at [WILDCARD]static_error.ts:1:18
diff --git a/cli/tests/testdata/import_assertions/static_error.ts b/cli/tests/testdata/import_attributes/static_error.ts
index 0bc3a93f8..0bc3a93f8 100644
--- a/cli/tests/testdata/import_assertions/static_error.ts
+++ b/cli/tests/testdata/import_attributes/static_error.ts
diff --git a/cli/tests/testdata/import_assertions/static_export.out b/cli/tests/testdata/import_attributes/static_export.out
index 42fbc066c..42fbc066c 100644
--- a/cli/tests/testdata/import_assertions/static_export.out
+++ b/cli/tests/testdata/import_attributes/static_export.out
diff --git a/cli/tests/testdata/import_assertions/static_export.ts b/cli/tests/testdata/import_attributes/static_export.ts
index ac3ee694f..ac3ee694f 100644
--- a/cli/tests/testdata/import_assertions/static_export.ts
+++ b/cli/tests/testdata/import_attributes/static_export.ts
diff --git a/cli/tests/testdata/import_assertions/static_import.out b/cli/tests/testdata/import_attributes/static_import.out
index 42fbc066c..b3b71cd8f 100644
--- a/cli/tests/testdata/import_assertions/static_import.out
+++ b/cli/tests/testdata/import_attributes/static_import.out
@@ -1,2 +1,3 @@
[WILDCARD]
{ a: "b", c: { d: 10 } }
+{ a: "b", c: { d: 10 } }
diff --git a/cli/tests/testdata/import_attributes/static_import.ts b/cli/tests/testdata/import_attributes/static_import.ts
new file mode 100644
index 000000000..d46d93b4a
--- /dev/null
+++ b/cli/tests/testdata/import_attributes/static_import.ts
@@ -0,0 +1,5 @@
+import data1 from "./data.json" with { type: "json" };
+import data2 from "./data.json" assert { type: "json" };
+
+console.log(data1);
+console.log(data2);
diff --git a/cli/tests/testdata/import_assertions/static_reexport.ts b/cli/tests/testdata/import_attributes/static_reexport.ts
index 81af428be..81af428be 100644
--- a/cli/tests/testdata/import_assertions/static_reexport.ts
+++ b/cli/tests/testdata/import_attributes/static_reexport.ts
diff --git a/cli/tests/testdata/import_attributes/type_check.out b/cli/tests/testdata/import_attributes/type_check.out
new file mode 100644
index 000000000..5ecdec82d
--- /dev/null
+++ b/cli/tests/testdata/import_attributes/type_check.out
@@ -0,0 +1,12 @@
+Check file:///[WILDCARD]/type_check.ts
+error: TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'.
+console.log(data1.foo);
+ ~~~
+ at [WILDCARD]type_check.ts:4:19
+
+TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'.
+console.log(data2.foo);
+ ~~~
+ at [WILDCARD]type_check.ts:5:19
+
+Found 2 errors.
diff --git a/cli/tests/testdata/import_attributes/type_check.ts b/cli/tests/testdata/import_attributes/type_check.ts
new file mode 100644
index 000000000..ddf28e67a
--- /dev/null
+++ b/cli/tests/testdata/import_attributes/type_check.ts
@@ -0,0 +1,5 @@
+import data1 from "./data.json" with { type: "json" };
+import data2 from "./data.json" assert { type: "json" };
+
+console.log(data1.foo);
+console.log(data2.foo);
diff --git a/cli/tests/testdata/run/020_json_modules.ts.out b/cli/tests/testdata/run/020_json_modules.ts.out
index da33c40bf..750363da2 100644
--- a/cli/tests/testdata/run/020_json_modules.ts.out
+++ b/cli/tests/testdata/run/020_json_modules.ts.out
@@ -1,4 +1,4 @@
[WILDCARD]
-error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import assertion with the type of "json".
+error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json".
Specifier: [WILDCARD]/subdir/config.json
[WILDCARD] \ No newline at end of file