summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-28 21:06:09 -0400
committerGitHub <noreply@github.com>2024-08-29 01:06:09 +0000
commit2afbc1aa39c37b688ea1e0c47161c2fcdefc05ab (patch)
tree783e4363b2838ff89d700387042ba5a79dd413ac /tests
parentd183533404bf7fe062331e414d5c2bc41e49d5e4 (diff)
feat: deprecate import assertions (#25281)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/specs/cache/json_import/main.ts2
-rw-r--r--tests/specs/run/ts_import_assertions/__test__.jsonc2
-rw-r--r--tests/specs/run/ts_import_assertions/assertion.out10
-rw-r--r--tests/testdata/import_attributes/static_export.out6
-rw-r--r--tests/testdata/import_attributes/static_import.out6
-rw-r--r--tests/testdata/import_attributes/static_import.ts3
-rw-r--r--tests/testdata/import_attributes/static_reexport.ts2
7 files changed, 6 insertions, 25 deletions
diff --git a/tests/specs/cache/json_import/main.ts b/tests/specs/cache/json_import/main.ts
index 78273558f..d7506963b 100644
--- a/tests/specs/cache/json_import/main.ts
+++ b/tests/specs/cache/json_import/main.ts
@@ -1,2 +1,2 @@
-import asdf from "./test.json" assert { type: "json" };
+import asdf from "./test.json" with { type: "json" };
console.log(asdf);
diff --git a/tests/specs/run/ts_import_assertions/__test__.jsonc b/tests/specs/run/ts_import_assertions/__test__.jsonc
index dc5576bd1..5d8110ae2 100644
--- a/tests/specs/run/ts_import_assertions/__test__.jsonc
+++ b/tests/specs/run/ts_import_assertions/__test__.jsonc
@@ -3,10 +3,12 @@
"assertion": {
"steps": [{
"args": "run assertion.ts",
+ "exitCode": 1,
"output": "assertion.out"
}, {
// should output the same because the emit won't be cached
"args": "run assertion.ts",
+ "exitCode": 1,
"output": "assertion.out"
}]
},
diff --git a/tests/specs/run/ts_import_assertions/assertion.out b/tests/specs/run/ts_import_assertions/assertion.out
index 3cc900d64..3ca7ac8ae 100644
--- a/tests/specs/run/ts_import_assertions/assertion.out
+++ b/tests/specs/run/ts_import_assertions/assertion.out
@@ -1,14 +1,6 @@
-⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.
+error: Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.
import test from "./data.json" assert { type: "json" };
at file:///[WILDLINE]/assertion.ts:1:1
-{ prop: "data" }
-⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.
-
-console.log((await import("./data.json", {
-
- at file:///[WILDLINE]/assertion.ts:5:13
-
-{ prop: "data" }
diff --git a/tests/testdata/import_attributes/static_export.out b/tests/testdata/import_attributes/static_export.out
index d7e19c80f..41af79d7c 100644
--- a/tests/testdata/import_attributes/static_export.out
+++ b/tests/testdata/import_attributes/static_export.out
@@ -1,7 +1 @@
-⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.
-
-export { default } from "./data.json" assert { type: "json" };
-
- at file:///[WILDLINE]
-
{ a: "b", c: { d: 10 } }
diff --git a/tests/testdata/import_attributes/static_import.out b/tests/testdata/import_attributes/static_import.out
index 85c75d3eb..e57dffa99 100644
--- a/tests/testdata/import_attributes/static_import.out
+++ b/tests/testdata/import_attributes/static_import.out
@@ -1,8 +1,2 @@
-⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.
-
-import data2 from "./data.json" assert { type: "json" };
-
- at file:///[WILDLINE]
-
{ a: "b", c: { d: 10 } }
{ a: "b", c: { d: 10 } }
diff --git a/tests/testdata/import_attributes/static_import.ts b/tests/testdata/import_attributes/static_import.ts
index 1538a4a2f..f585b893f 100644
--- a/tests/testdata/import_attributes/static_import.ts
+++ b/tests/testdata/import_attributes/static_import.ts
@@ -1,6 +1,5 @@
import data1 from "./data.json" with { type: "json" };
-// deno-lint-ignore no-import-assertions
-import data2 from "./data.json" assert { type: "json" };
+import data2 from "./data.json" with { type: "json" };
console.log(data1);
console.log(data2);
diff --git a/tests/testdata/import_attributes/static_reexport.ts b/tests/testdata/import_attributes/static_reexport.ts
index 81af428be..e6175691c 100644
--- a/tests/testdata/import_attributes/static_reexport.ts
+++ b/tests/testdata/import_attributes/static_reexport.ts
@@ -1 +1 @@
-export { default } from "./data.json" assert { type: "json" };
+export { default } from "./data.json" with { type: "json" };