diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-05 10:34:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 10:34:51 -0400 |
commit | 049e703331409db8c4b4e2cc7d969f471c229df3 (patch) | |
tree | a31458a651e931d2047c348bdcbe0379470bf925 /tests/specs/npm/future_node_modules_dir_setting | |
parent | ee4bfe16009c3a04c9015bf9fca0c9b0f9a3a601 (diff) |
FUTURE: override byonm with nodeModulesDir setting (#23222)
Makes the `"nodeModulesDir"` setting take precedence over byonm when
using `DENO_FUTURE`.
Diffstat (limited to 'tests/specs/npm/future_node_modules_dir_setting')
5 files changed, 31 insertions, 0 deletions
diff --git a/tests/specs/npm/future_node_modules_dir_setting/__test__.jsonc b/tests/specs/npm/future_node_modules_dir_setting/__test__.jsonc new file mode 100644 index 000000000..b7c3b90d7 --- /dev/null +++ b/tests/specs/npm/future_node_modules_dir_setting/__test__.jsonc @@ -0,0 +1,20 @@ +{ + "envs": { + "DENO_FUTURE": "1" + }, + "tempDir": true, + "steps": [{ + // byonm where this fails be + "args": "run main.ts", + "output": "failed.out", + "exitCode": 1 + }, { + // this should override byonm + "args": "run --node-modules-dir=false --quiet main.ts", + "output": "main.out" + }, { + // same with this + "args": "run --node-modules-dir --quiet main.ts", + "output": "main.out" + }] +} diff --git a/tests/specs/npm/future_node_modules_dir_setting/failed.out b/tests/specs/npm/future_node_modules_dir_setting/failed.out new file mode 100644 index 000000000..1c2bc1d98 --- /dev/null +++ b/tests/specs/npm/future_node_modules_dir_setting/failed.out @@ -0,0 +1 @@ +error: Could not resolve "@denotest/esm-basic", but found it in a package.json.[WILDCARD] diff --git a/tests/specs/npm/future_node_modules_dir_setting/main.out b/tests/specs/npm/future_node_modules_dir_setting/main.out new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/specs/npm/future_node_modules_dir_setting/main.out @@ -0,0 +1 @@ +2 diff --git a/tests/specs/npm/future_node_modules_dir_setting/main.ts b/tests/specs/npm/future_node_modules_dir_setting/main.ts new file mode 100644 index 000000000..99972873b --- /dev/null +++ b/tests/specs/npm/future_node_modules_dir_setting/main.ts @@ -0,0 +1,4 @@ +import { getValue, setValue } from "@denotest/esm-basic"; + +setValue(2); +console.log(getValue()); diff --git a/tests/specs/npm/future_node_modules_dir_setting/package.json b/tests/specs/npm/future_node_modules_dir_setting/package.json new file mode 100644 index 000000000..54ca824d6 --- /dev/null +++ b/tests/specs/npm/future_node_modules_dir_setting/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@denotest/esm-basic": "*" + } +} |