summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-20 16:32:01 -0400
committerGitHub <noreply@github.com>2024-08-20 16:32:01 -0400
commit37279e0b0a4300318da472bf0a8bdb894746537f (patch)
treefffc0425e931f70e8297456ddbf7b106fb72e9e9 /tests/specs
parenta7c002ae634b20a2f84c90417327a88c9ac2df99 (diff)
fix(add): error when config file contains importMap field (#25115)
The "imports" field has higher precedence than "importMap", so we should error when `deno add` goes to add an `"imports"` field. Closes https://github.com/denoland/deno/issues/24264 Closes https://github.com/denoland/deno/pull/24478
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/add/error_import_map_field/__test__.jsonc5
-rw-r--r--tests/specs/add/error_import_map_field/add.out2
-rw-r--r--tests/specs/add/error_import_map_field/deno.json3
-rw-r--r--tests/specs/add/error_import_map_field/import_map.json1
4 files changed, 11 insertions, 0 deletions
diff --git a/tests/specs/add/error_import_map_field/__test__.jsonc b/tests/specs/add/error_import_map_field/__test__.jsonc
new file mode 100644
index 000000000..bf26b74e4
--- /dev/null
+++ b/tests/specs/add/error_import_map_field/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "add jsr:@denotest/add",
+ "output": "add.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/add/error_import_map_field/add.out b/tests/specs/add/error_import_map_field/add.out
new file mode 100644
index 000000000..ab787ea78
--- /dev/null
+++ b/tests/specs/add/error_import_map_field/add.out
@@ -0,0 +1,2 @@
+error: `deno add` is not supported when configuration file contains an "importMap" field. Inline the import map into the Deno configuration file.
+ at file:///[WILDLINE]/deno.json
diff --git a/tests/specs/add/error_import_map_field/deno.json b/tests/specs/add/error_import_map_field/deno.json
new file mode 100644
index 000000000..12a79304f
--- /dev/null
+++ b/tests/specs/add/error_import_map_field/deno.json
@@ -0,0 +1,3 @@
+{
+ "importMap": "./import_map.json"
+}
diff --git a/tests/specs/add/error_import_map_field/import_map.json b/tests/specs/add/error_import_map_field/import_map.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/tests/specs/add/error_import_map_field/import_map.json
@@ -0,0 +1 @@
+{}