summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-07-24 16:37:13 -0700
committerGitHub <noreply@github.com>2024-07-24 23:37:13 +0000
commit795ed23b356dc044cfb497a6189d588604a6c335 (patch)
treeb1e53bac1b69cab4ff0f3da181426bbf024be457 /tests/specs
parent1fad6eb2acc993714fad9d333f409495f5b3d6db (diff)
fix(future): Emit `deno install` warning less often, suggest `deno install` in error message (#24706)
Two small changes: - In our BYONM errors, suggest running `deno install` instead of `npm install` if `DENO_FUTURE` is set - Only emit warning about `deno install` changes if you do `deno install <foo>` with deno_future unset
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/compile/npmrc_byonm/install.out1
-rw-r--r--tests/specs/install/future_install_local_add_deno/install.out1
-rw-r--r--tests/specs/install/future_install_local_add_npm/install.out1
-rw-r--r--tests/specs/install/future_install_local_deno/install.out1
-rw-r--r--tests/specs/install/future_install_node_modules/corrupted.out1
-rw-r--r--tests/specs/install/future_install_node_modules/install.out1
-rw-r--r--tests/specs/install/future_install_node_modules/install_lockfile.out1
-rw-r--r--tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed_install.out1
-rw-r--r--tests/specs/npm/bin_entries_prefer_closer/install.out1
-rw-r--r--tests/specs/npm/byonm/__test__.jsonc52
-rw-r--r--tests/specs/npm/byonm/future_invalid_sub_path.out2
-rw-r--r--tests/specs/npm/byonm/future_not_installed.out2
-rw-r--r--tests/specs/npm/byonm/invalid_sub_path.out2
-rw-r--r--tests/specs/npm/byonm/invalid_sub_path.ts1
-rw-r--r--tests/specs/npm/byonm/not_installed.out2
-rw-r--r--tests/specs/npm/byonm/not_installed.ts2
-rw-r--r--tests/specs/npm/byonm/package.json6
-rw-r--r--tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out1
-rw-r--r--tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out1
-rw-r--r--tests/specs/npm/npmrc/install.out1
-rw-r--r--tests/specs/npm/npmrc_bad_registry_config/main.out1
-rw-r--r--tests/specs/npm/npmrc_bad_token/main.out1
-rw-r--r--tests/specs/npm/npmrc_basic_auth/install.out1
-rw-r--r--tests/specs/npm/npmrc_homedir/install.out1
24 files changed, 69 insertions, 16 deletions
diff --git a/tests/specs/compile/npmrc_byonm/install.out b/tests/specs/compile/npmrc_byonm/install.out
index 5c2ff3562..30643527e 100644
--- a/tests/specs/compile/npmrc_byonm/install.out
+++ b/tests/specs/compile/npmrc_byonm/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4261/@denotest/basic
Download http://localhost:4262/@denotest2/basic
diff --git a/tests/specs/install/future_install_local_add_deno/install.out b/tests/specs/install/future_install_local_add_deno/install.out
index df58284fc..0c87a04aa 100644
--- a/tests/specs/install/future_install_local_add_deno/install.out
+++ b/tests/specs/install/future_install_local_add_deno/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Add @denotest/esm-basic - npm:@denotest/esm-basic@^1.0.0
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
diff --git a/tests/specs/install/future_install_local_add_npm/install.out b/tests/specs/install/future_install_local_add_npm/install.out
index d9c23abf0..76939659f 100644
--- a/tests/specs/install/future_install_local_add_npm/install.out
+++ b/tests/specs/install/future_install_local_add_npm/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Add @denotest/esm-basic - npm:@denotest/esm-basic@^1.0.0
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
diff --git a/tests/specs/install/future_install_local_deno/install.out b/tests/specs/install/future_install_local_deno/install.out
index 713507f02..eecba1299 100644
--- a/tests/specs/install/future_install_local_deno/install.out
+++ b/tests/specs/install/future_install_local_deno/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4545/v1/extensionless
Download http://localhost:4545/subdir/mod1.ts
diff --git a/tests/specs/install/future_install_node_modules/corrupted.out b/tests/specs/install/future_install_node_modules/corrupted.out
index 9943c1ce9..ade075744 100644
--- a/tests/specs/install/future_install_node_modules/corrupted.out
+++ b/tests/specs/install/future_install_node_modules/corrupted.out
@@ -1,3 +1,2 @@
-[WILDCARD]
error: Integrity check failed for package: "npm:@denotest/esm-basic@1.0.0".[WILDCARD]
Use the --lock-write flag to regenerate the lockfile at [WILDCARD] \ No newline at end of file
diff --git a/tests/specs/install/future_install_node_modules/install.out b/tests/specs/install/future_install_node_modules/install.out
index 22574688a..b8114c12a 100644
--- a/tests/specs/install/future_install_node_modules/install.out
+++ b/tests/specs/install/future_install_node_modules/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/esm-basic@1.0.0
diff --git a/tests/specs/install/future_install_node_modules/install_lockfile.out b/tests/specs/install/future_install_node_modules/install_lockfile.out
index 3e27e3d20..05a104a3a 100644
--- a/tests/specs/install/future_install_node_modules/install_lockfile.out
+++ b/tests/specs/install/future_install_node_modules/install_lockfile.out
@@ -1,2 +1 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Initialize @denotest/esm-basic@1.0.0
diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed_install.out b/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed_install.out
index 14530d573..6b7d1dc5f 100644
--- a/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed_install.out
+++ b/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed_install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
5 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0"
diff --git a/tests/specs/npm/bin_entries_prefer_closer/install.out b/tests/specs/npm/bin_entries_prefer_closer/install.out
index 25e06db99..1d3a995b8 100644
--- a/tests/specs/npm/bin_entries_prefer_closer/install.out
+++ b/tests/specs/npm/bin_entries_prefer_closer/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4260/@denotest/transitive-bin
Download http://localhost:4260/@denotest/bin
diff --git a/tests/specs/npm/byonm/__test__.jsonc b/tests/specs/npm/byonm/__test__.jsonc
new file mode 100644
index 000000000..8edb6b0bf
--- /dev/null
+++ b/tests/specs/npm/byonm/__test__.jsonc
@@ -0,0 +1,52 @@
+{
+ "tempDir": true,
+ "tests": {
+ "future_not_installed": {
+ "envs": {
+ "DENO_FUTURE": "1"
+ },
+ "steps": [{
+ "args": "run -A not_installed.ts",
+ "output": "future_not_installed.out",
+ "exitCode": 1
+ }]
+ },
+ "future_invalid_sub_path": {
+ "envs": {
+ "DENO_FUTURE": "1"
+ },
+ "steps": [{
+ "args": "install",
+ "output": "[WILDCARD]"
+ }, {
+ "args": "run -A invalid_sub_path.ts",
+ "output": "invalid_sub_path.out",
+ "exitCode": 1
+ }]
+ },
+ "not_installed": {
+ "envs": {
+ "DENO_UNSTABLE_BYONM": "1"
+ },
+ "steps": [{
+ "args": "run -A not_installed.ts",
+ "output": "not_installed.out",
+ "exitCode": 1
+ }]
+ },
+ "invalid_sub_path": {
+ "envs": {
+ "DENO_UNSTABLE_BYONM": "1"
+ },
+ "steps": [{
+ "args": "install",
+ "commandName": "npm",
+ "output": "[WILDCARD]"
+ }, {
+ "args": "run -A invalid_sub_path.ts",
+ "output": "invalid_sub_path.out",
+ "exitCode": 1
+ }]
+ }
+ }
+}
diff --git a/tests/specs/npm/byonm/future_invalid_sub_path.out b/tests/specs/npm/byonm/future_invalid_sub_path.out
new file mode 100644
index 000000000..36ced4708
--- /dev/null
+++ b/tests/specs/npm/byonm/future_invalid_sub_path.out
@@ -0,0 +1,2 @@
+error: [ERR_PACKAGE_PATH_NOT_EXPORTED] Package subpath './test' is not defined by "exports" in '[WILDLINE]package.json' imported from '[WILDLINE]invalid_sub_path.ts'
+ at file:///[WILDLINE]/invalid_sub_path.ts:1:8
diff --git a/tests/specs/npm/byonm/future_not_installed.out b/tests/specs/npm/byonm/future_not_installed.out
new file mode 100644
index 000000000..2e608c37e
--- /dev/null
+++ b/tests/specs/npm/byonm/future_not_installed.out
@@ -0,0 +1,2 @@
+error: Could not find "chalk" in a node_modules folder. Deno expects the node_modules/ directory to be up to date. Did you forget to run `deno install`?
+ at file:///[WILDCARD]/not_installed.ts:1:19
diff --git a/tests/specs/npm/byonm/invalid_sub_path.out b/tests/specs/npm/byonm/invalid_sub_path.out
new file mode 100644
index 000000000..36ced4708
--- /dev/null
+++ b/tests/specs/npm/byonm/invalid_sub_path.out
@@ -0,0 +1,2 @@
+error: [ERR_PACKAGE_PATH_NOT_EXPORTED] Package subpath './test' is not defined by "exports" in '[WILDLINE]package.json' imported from '[WILDLINE]invalid_sub_path.ts'
+ at file:///[WILDLINE]/invalid_sub_path.ts:1:8
diff --git a/tests/specs/npm/byonm/invalid_sub_path.ts b/tests/specs/npm/byonm/invalid_sub_path.ts
new file mode 100644
index 000000000..bed8754d5
--- /dev/null
+++ b/tests/specs/npm/byonm/invalid_sub_path.ts
@@ -0,0 +1 @@
+import "npm:@denotest/conditional-exports-strict/test";
diff --git a/tests/specs/npm/byonm/not_installed.out b/tests/specs/npm/byonm/not_installed.out
new file mode 100644
index 000000000..29f865140
--- /dev/null
+++ b/tests/specs/npm/byonm/not_installed.out
@@ -0,0 +1,2 @@
+error: Could not find "chalk" in a node_modules folder. Deno expects the node_modules/ directory to be up to date. Did you forget to run `npm install`?
+ at file:///[WILDCARD]/not_installed.ts:1:19
diff --git a/tests/specs/npm/byonm/not_installed.ts b/tests/specs/npm/byonm/not_installed.ts
new file mode 100644
index 000000000..4cd4b83f6
--- /dev/null
+++ b/tests/specs/npm/byonm/not_installed.ts
@@ -0,0 +1,2 @@
+import chalk from "npm:chalk";
+console.log(chalk.green("hi"));
diff --git a/tests/specs/npm/byonm/package.json b/tests/specs/npm/byonm/package.json
new file mode 100644
index 000000000..8d3b59104
--- /dev/null
+++ b/tests/specs/npm/byonm/package.json
@@ -0,0 +1,6 @@
+{
+ "dependencies": {
+ "chalk": "4",
+ "@denotest/conditional-exports-strict": "1"
+ }
+}
diff --git a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out
index 059afdfaa..f62079d3f 100644
--- a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out
+++ b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
preinstall
deno preinstall.js
node preinstall.js
diff --git a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out
index 8db36055f..7d432ead9 100644
--- a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out
+++ b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4260/@denotest/node-lifecycle-scripts
Download http://localhost:4260/@denotest/bin
diff --git a/tests/specs/npm/npmrc/install.out b/tests/specs/npm/npmrc/install.out
index 5c2ff3562..30643527e 100644
--- a/tests/specs/npm/npmrc/install.out
+++ b/tests/specs/npm/npmrc/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4261/@denotest/basic
Download http://localhost:4262/@denotest2/basic
diff --git a/tests/specs/npm/npmrc_bad_registry_config/main.out b/tests/specs/npm/npmrc_bad_registry_config/main.out
index 17619e5ce..990d4a47f 100644
--- a/tests/specs/npm/npmrc_bad_registry_config/main.out
+++ b/tests/specs/npm/npmrc_bad_registry_config/main.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Download http://localhost:4261/@denotest/basic
error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Bad response: 401
[WILDCARD] \ No newline at end of file
diff --git a/tests/specs/npm/npmrc_bad_token/main.out b/tests/specs/npm/npmrc_bad_token/main.out
index 17619e5ce..990d4a47f 100644
--- a/tests/specs/npm/npmrc_bad_token/main.out
+++ b/tests/specs/npm/npmrc_bad_token/main.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Download http://localhost:4261/@denotest/basic
error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Bad response: 401
[WILDCARD] \ No newline at end of file
diff --git a/tests/specs/npm/npmrc_basic_auth/install.out b/tests/specs/npm/npmrc_basic_auth/install.out
index 5c2ff3562..30643527e 100644
--- a/tests/specs/npm/npmrc_basic_auth/install.out
+++ b/tests/specs/npm/npmrc_basic_auth/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4261/@denotest/basic
Download http://localhost:4262/@denotest2/basic
diff --git a/tests/specs/npm/npmrc_homedir/install.out b/tests/specs/npm/npmrc_homedir/install.out
index 5c2ff3562..30643527e 100644
--- a/tests/specs/npm/npmrc_homedir/install.out
+++ b/tests/specs/npm/npmrc_homedir/install.out
@@ -1,4 +1,3 @@
-⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
[UNORDERED_START]
Download http://localhost:4261/@denotest/basic
Download http://localhost:4262/@denotest2/basic