diff options
| author | Bartek Iwańczuk <biwanczuk@gmail.com> | 2024-08-19 21:36:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-19 22:36:35 +0200 |
| commit | b5051e25c219c188f17d499ee4e101a64eb62e37 (patch) | |
| tree | 88c6ab12aefd491d52e638c6e5043728412bca9b /tests/specs | |
| parent | bf510544ef26b89d4c2ae935893eaf62995ed903 (diff) | |
feat: Deprecate "import assertions" with a warning (#24743)
This commit deprecates "import assertions" proposal that has been
replaced with "import attributes".
Any time an import assertion is encountered a warning will be printed
to the terminal. This warning will be printed for both local and
remote files (ie. user code and dependencies).
Import assertions support will be removed in Deno 2.
Diffstat (limited to 'tests/specs')
| -rw-r--r-- | tests/specs/future/import_assertions/__test__.jsonc | 9 | ||||
| -rw-r--r-- | tests/specs/future/import_assertions/success.out | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/specs/future/import_assertions/__test__.jsonc b/tests/specs/future/import_assertions/__test__.jsonc index a1e759c75..1c55d2220 100644 --- a/tests/specs/future/import_assertions/__test__.jsonc +++ b/tests/specs/future/import_assertions/__test__.jsonc @@ -8,6 +8,15 @@ "DENO_FUTURE": "1" } }, + // Running the same multiple times, should warn each time. + { + "args": "run main.js", + "output": "error.out", + "exitCode": 1, + "envs": { + "DENO_FUTURE": "1" + } + }, { "args": "run main.js", "output": "success.out" diff --git a/tests/specs/future/import_assertions/success.out b/tests/specs/future/import_assertions/success.out index 70ec274d9..fcf28b943 100644 --- a/tests/specs/future/import_assertions/success.out +++ b/tests/specs/future/import_assertions/success.out @@ -1 +1,7 @@ +⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword. + +import foo from "./main.json" assert { type: "json" }; + + at [WILDCARD]import_assertions/main.js:1:30 + { foo: "foo" } |
