diff options
Diffstat (limited to 'tests/specs/npm')
160 files changed, 729 insertions, 211 deletions
diff --git a/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out b/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out index fe612aa3c..44c76f28d 100644 --- a/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out +++ b/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out @@ -1,8 +1,8 @@ -Download http://localhost:4260/@denotest/add +Download http://localhost:4260/@denotest%2fadd Download http://localhost:4260/@denotest/add/1.0.0.tgz Initialize @denotest/add@1.0.0 3 -Download http://localhost:4260/@denotest/subtract +Download http://localhost:4260/@denotest%2fsubtract Download http://localhost:4260/@denotest/subtract/1.0.0.tgz Initialize @denotest/subtract@1.0.0 1 diff --git a/tests/specs/npm/bin_entries_prefer_closer/install.out b/tests/specs/npm/bin_entries_prefer_closer/install.out index 1d3a995b8..1c9472f46 100644 --- a/tests/specs/npm/bin_entries_prefer_closer/install.out +++ b/tests/specs/npm/bin_entries_prefer_closer/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/transitive-bin -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2ftransitive-bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Download http://localhost:4260/@denotest/transitive-bin/1.0.0.tgz Download http://localhost:4260/@denotest/bin/0.7.0.tgz diff --git a/tests/specs/npm/bin_entry_created_by_lifecycle/__test__.jsonc b/tests/specs/npm/bin_entry_created_by_lifecycle/__test__.jsonc new file mode 100644 index 000000000..665aec823 --- /dev/null +++ b/tests/specs/npm/bin_entry_created_by_lifecycle/__test__.jsonc @@ -0,0 +1,29 @@ +{ + "tempDir": true, + "tests": { + "all_at_once": { + "steps": [ + { + "args": "install --allow-scripts", + "output": "all_at_once_install.out" + }, + { "args": "task run-testbin", "output": "run_testbin.out" } + ] + }, + "separate_steps": { + "steps": [ + { "if": "unix", "args": "install", "output": "install_warn.out" }, + { + "if": "windows", + "args": "install", + "output": "install_warn_windows.out" + }, + { + "args": "install --allow-scripts", + "output": "Initialize @denotest/bin-created-by-lifecycle@1.0.0: running 'install' script\n" + }, + { "args": "task run-testbin", "output": "run_testbin.out" } + ] + } + } +} diff --git a/tests/specs/npm/bin_entry_created_by_lifecycle/all_at_once_install.out b/tests/specs/npm/bin_entry_created_by_lifecycle/all_at_once_install.out new file mode 100644 index 000000000..bfaba3caf --- /dev/null +++ b/tests/specs/npm/bin_entry_created_by_lifecycle/all_at_once_install.out @@ -0,0 +1,4 @@ +Download http://localhost:4260/@denotest%2fbin-created-by-lifecycle +Download http://localhost:4260/@denotest/bin-created-by-lifecycle/1.0.0.tgz +Initialize @denotest/bin-created-by-lifecycle@1.0.0 +Initialize @denotest/bin-created-by-lifecycle@1.0.0: running 'install' script diff --git a/tests/specs/npm/bin_entry_created_by_lifecycle/install_warn.out b/tests/specs/npm/bin_entry_created_by_lifecycle/install_warn.out new file mode 100644 index 000000000..864a3f6f5 --- /dev/null +++ b/tests/specs/npm/bin_entry_created_by_lifecycle/install_warn.out @@ -0,0 +1,10 @@ +Download http://localhost:4260/@denotest%2fbin-created-by-lifecycle +Download http://localhost:4260/@denotest/bin-created-by-lifecycle/1.0.0.tgz +Initialize @denotest/bin-created-by-lifecycle@1.0.0 +Warning Trying to set up 'testbin' bin for "[WILDCARD]bin-created-by-lifecycle", but the entry point "[WILDCARD]testbin.js" doesn't exist. +Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed: +┠─ npm:@denotest/bin-created-by-lifecycle@1.0.0 +┃ +┠─ This may cause the packages to not work correctly. +┖─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`: + deno install --allow-scripts=npm:@denotest/bin-created-by-lifecycle@1.0.0 diff --git a/tests/specs/npm/bin_entry_created_by_lifecycle/install_warn_windows.out b/tests/specs/npm/bin_entry_created_by_lifecycle/install_warn_windows.out new file mode 100644 index 000000000..683808873 --- /dev/null +++ b/tests/specs/npm/bin_entry_created_by_lifecycle/install_warn_windows.out @@ -0,0 +1,9 @@ +Download http://localhost:4260/@denotest%2fbin-created-by-lifecycle +Download http://localhost:4260/@denotest/bin-created-by-lifecycle/1.0.0.tgz +Initialize @denotest/bin-created-by-lifecycle@1.0.0 +Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed: +┠─ npm:@denotest/bin-created-by-lifecycle@1.0.0 +┃ +┠─ This may cause the packages to not work correctly. +┖─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`: + deno install --allow-scripts=npm:@denotest/bin-created-by-lifecycle@1.0.0 diff --git a/tests/specs/npm/bin_entry_created_by_lifecycle/package.json b/tests/specs/npm/bin_entry_created_by_lifecycle/package.json new file mode 100644 index 000000000..9a8941ed9 --- /dev/null +++ b/tests/specs/npm/bin_entry_created_by_lifecycle/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "@denotest/bin-created-by-lifecycle": "1.0.0" + }, + "scripts": { + "run-testbin": "testbin" + } +} diff --git a/tests/specs/npm/bin_entry_created_by_lifecycle/run_testbin.out b/tests/specs/npm/bin_entry_created_by_lifecycle/run_testbin.out new file mode 100644 index 000000000..a03f8bc58 --- /dev/null +++ b/tests/specs/npm/bin_entry_created_by_lifecycle/run_testbin.out @@ -0,0 +1,2 @@ +Task run-testbin testbin +run testbin diff --git a/tests/specs/npm/check_all/check_errors/main_all.out b/tests/specs/npm/check_all/check_errors/main_all.out index 4c624c0ea..c7797e43d 100644 --- a/tests/specs/npm/check_all/check_errors/main_all.out +++ b/tests/specs/npm/check_all/check_errors/main_all.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest%2fcheck-error Download http://localhost:4260/@denotest/check-error/1.0.0.tgz Check file:///[WILDCARD]/check_errors/main.ts error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. diff --git a/tests/specs/npm/check_all/check_errors/main_local.out b/tests/specs/npm/check_all/check_errors/main_local.out index 4d3a892e7..ac58a29c7 100644 --- a/tests/specs/npm/check_all/check_errors/main_local.out +++ b/tests/specs/npm/check_all/check_errors/main_local.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest%2fcheck-error Download http://localhost:4260/@denotest/check-error/1.0.0.tgz Check file:///[WILDCARD]/check_errors/main.ts error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. diff --git a/tests/specs/npm/check_local/check_errors/main_all.out b/tests/specs/npm/check_local/check_errors/main_all.out index 4c624c0ea..c7797e43d 100644 --- a/tests/specs/npm/check_local/check_errors/main_all.out +++ b/tests/specs/npm/check_local/check_errors/main_all.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest%2fcheck-error Download http://localhost:4260/@denotest/check-error/1.0.0.tgz Check file:///[WILDCARD]/check_errors/main.ts error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. diff --git a/tests/specs/npm/check_local/check_errors/main_local.out b/tests/specs/npm/check_local/check_errors/main_local.out index 1a150b5e6..1eb8eef9f 100644 --- a/tests/specs/npm/check_local/check_errors/main_local.out +++ b/tests/specs/npm/check_local/check_errors/main_local.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest%2fcheck-error Download http://localhost:4260/@denotest/check-error/1.0.0.tgz Check file:///[WILDCARD]/check_errors/main.ts error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. diff --git a/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out index 507d2c2f7..6ab72f53b 100644 --- a/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out +++ b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/file-dts-dmts-dcts +Download http://localhost:4260/@denotest%2ffile-dts-dmts-dcts Download http://localhost:4260/@denotest/file-dts-dmts-dcts/1.0.0.tgz Check file:///[WILDCARD]/main.ts error: TS2322 [ERROR]: Type '5' is not assignable to type '"dts"'. diff --git a/tests/specs/npm/check_pkg_json_import/main.out b/tests/specs/npm/check_pkg_json_import/main.out index b60509c9a..11f94272a 100644 --- a/tests/specs/npm/check_pkg_json_import/main.out +++ b/tests/specs/npm/check_pkg_json_import/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/types-pkg-json-import +Download http://localhost:4260/@denotest%2ftypes-pkg-json-import Download http://localhost:4260/@denotest/types-pkg-json-import/1.0.0.tgz Check file:///[WILDLINE]/main.ts diff --git a/tests/specs/npm/cjs_import_dual/check.out b/tests/specs/npm/cjs_import_dual/check.out index be1fe86a6..c2d1daa17 100644 --- a/tests/specs/npm/cjs_import_dual/check.out +++ b/tests/specs/npm/cjs_import_dual/check.out @@ -1,5 +1,5 @@ -Download http://localhost:4260/@denotest/cjs-import-dual -Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest%2fcjs-import-dual +Download http://localhost:4260/@denotest%2fdual-cjs-esm Download http://localhost:4260/@denotest/cjs-import-dual/1.0.0.tgz Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz Check file:///[WILDLINE]/cjs_import_dual/main.ts diff --git a/tests/specs/npm/cjs_import_dual/run.out b/tests/specs/npm/cjs_import_dual/run.out index 2c05e125e..0307bf250 100644 --- a/tests/specs/npm/cjs_import_dual/run.out +++ b/tests/specs/npm/cjs_import_dual/run.out @@ -1,5 +1,5 @@ -Download http://localhost:4260/@denotest/cjs-import-dual -Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest%2fcjs-import-dual +Download http://localhost:4260/@denotest%2fdual-cjs-esm Download http://localhost:4260/@denotest/cjs-import-dual/1.0.0.tgz Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz cjs diff --git a/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out index 5e7a36c8d..5c48b5b5c 100644 --- a/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out +++ b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/cjs-local-global-decls +Download http://localhost:4260/@denotest%2fcjs-local-global-decls Download http://localhost:4260/@denotest/cjs-local-global-decls/1.0.0.tgz Loaded. diff --git a/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out index 661146bd0..f9390fb1b 100644 --- a/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out +++ b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/cjs-pkg-imports +Download http://localhost:4260/@denotest%2fcjs-pkg-imports Download http://localhost:4260/@denotest/cjs-pkg-imports/1.0.0.tgz { crypto: Crypto { subtle: SubtleCrypto {} }, number: 5 } diff --git a/tests/specs/npm/compare_globals/__test__.jsonc b/tests/specs/npm/compare_globals/__test__.jsonc index e096ddeb2..96458306a 100644 --- a/tests/specs/npm/compare_globals/__test__.jsonc +++ b/tests/specs/npm/compare_globals/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "run --allow-read --check=all compare_globals/main.ts", - "output": "compare_globals/main.out" + "args": "run --allow-read --check=all main.ts", + "output": "main.out" } diff --git a/tests/specs/npm/compare_globals/compare_globals/main.out b/tests/specs/npm/compare_globals/main.out index a1b0a566d..290e9c3b2 100644 --- a/tests/specs/npm/compare_globals/compare_globals/main.out +++ b/tests/specs/npm/compare_globals/main.out @@ -1,17 +1,18 @@ [UNORDERED_START] -Download http://localhost:4260/@types/node +Download http://localhost:4260/@types%2fnode Download http://localhost:4260/undici-types -Download http://localhost:4260/@denotest/globals +Download http://localhost:4260/@denotest%2fglobals [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/globals/1.0.0.tgz Download http://localhost:4260/@types/node/node-22.5.4.tgz Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz [UNORDERED_END] -Check file:///[WILDCARD]/compare_globals/main.ts +Check file:///[WILDCARD]/main.ts true true [] +process equals process true setTimeout 1 false setTimeout 2 function setTimeout 3 function diff --git a/tests/specs/npm/compare_globals/compare_globals/main.ts b/tests/specs/npm/compare_globals/main.ts index 9482798d8..308ce9b23 100644 --- a/tests/specs/npm/compare_globals/compare_globals/main.ts +++ b/tests/specs/npm/compare_globals/main.ts @@ -5,10 +5,17 @@ console.log(globals.global === globals.globalThis); // @ts-expect-error even though these are the same object, they have different types console.log(globals.globalThis === globalThis); console.log(globals.process.execArgv); +console.log("process equals process", process === globals.process); type AssertTrue<T extends true> = never; -type _TestNoProcessGlobal = AssertTrue< - typeof globalThis extends { process: any } ? false : true +type _TestHasProcessGlobal = AssertTrue< + typeof globalThis extends { process: any } ? true : false +>; +type _TestProcessGlobalVersion = AssertTrue< + typeof process.versions.node extends string ? true : false +>; +type _TestNoBufferGlogal = AssertTrue< + typeof globalThis extends { Buffer: any } ? false : true >; type _TestHasNodeJsGlobal = NodeJS.Architecture; diff --git a/tests/specs/npm/conditional_exports/main.out b/tests/specs/npm/conditional_exports/main.out index 8bd31321b..8b5b2715b 100644 --- a/tests/specs/npm/conditional_exports/main.out +++ b/tests/specs/npm/conditional_exports/main.out @@ -1,8 +1,8 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/conditional-exports +Download http://localhost:4260/@denotest%2fconditional-exports Download http://localhost:4260/supports-esm Download http://localhost:4260/has-package-exports -Download http://localhost:4260/@ljharb/has-package-exports-patterns +Download http://localhost:4260/@ljharb%2fhas-package-exports-patterns [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/conditional-exports/1.0.0.tgz diff --git a/tests/specs/npm/conditional_exports_node_modules_dir/main.out b/tests/specs/npm/conditional_exports_node_modules_dir/main.out index 5fbba560d..ee4a64be6 100644 --- a/tests/specs/npm/conditional_exports_node_modules_dir/main.out +++ b/tests/specs/npm/conditional_exports_node_modules_dir/main.out @@ -1,8 +1,8 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/conditional-exports +Download http://localhost:4260/@denotest%2fconditional-exports Download http://localhost:4260/supports-esm Download http://localhost:4260/has-package-exports -Download http://localhost:4260/@ljharb/has-package-exports-patterns +Download http://localhost:4260/@ljharb%2fhas-package-exports-patterns [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/conditional-exports/1.0.0.tgz diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out index a700b8fdb..c1eb2a480 100644 --- a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest%2fsub-folders Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts Did you mean to import index.js within the directory? diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out index 844419b4c..c19c4bcaa 100644 --- a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest%2fsub-folders Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out index a700b8fdb..c1eb2a480 100644 --- a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out +++ b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest%2fsub-folders Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts Did you mean to import index.js within the directory? diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out index 844419b4c..c19c4bcaa 100644 --- a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out +++ b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest%2fsub-folders Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts diff --git a/tests/specs/npm/dual_cjs_esm/__test__.jsonc b/tests/specs/npm/dual_cjs_esm/__test__.jsonc deleted file mode 100644 index f2b0d694e..000000000 --- a/tests/specs/npm/dual_cjs_esm/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run -A --quiet dual_cjs_esm/main.ts", - "output": "dual_cjs_esm/main.out" -} diff --git a/tests/specs/npm/dual_cjs_esm/cjs_referrer/__test__.jsonc b/tests/specs/npm/dual_cjs_esm/cjs_referrer/__test__.jsonc new file mode 100644 index 000000000..de2c1a0bc --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/cjs_referrer/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tempDir": true, + "tests": { + "check": { + "args": "check --node-modules-dir=auto main.cts", + "output": "check.out", + "exitCode": 1 + }, + "run": { + "args": "run --node-modules-dir=auto --allow-read main.cts", + "output": "main.out" + } + } +} diff --git a/tests/specs/npm/dual_cjs_esm/cjs_referrer/check.out b/tests/specs/npm/dual_cjs_esm/cjs_referrer/check.out new file mode 100644 index 000000000..267d31fb7 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/cjs_referrer/check.out @@ -0,0 +1,8 @@ +Download http://localhost:4260/@denotest%2fdual-cjs-esm +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +Initialize @denotest/dual-cjs-esm@1.0.0 +Check file:///[WILDLINE]/main.cts +error: TS2322 [ERROR]: Type '"cjs"' is not assignable to type '"other"'. +const kind: "other" = mod.getKind(); + ~~~~ + at file:///[WILDLINE]/main.cts:3:7 diff --git a/tests/specs/npm/dual_cjs_esm/cjs_referrer/main.cts b/tests/specs/npm/dual_cjs_esm/cjs_referrer/main.cts new file mode 100644 index 000000000..b8dd343f8 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/cjs_referrer/main.cts @@ -0,0 +1,4 @@ +import mod = require("@denotest/dual-cjs-esm"); + +const kind: "other" = mod.getKind(); +console.log(kind); diff --git a/tests/specs/npm/dual_cjs_esm/cjs_referrer/main.out b/tests/specs/npm/dual_cjs_esm/cjs_referrer/main.out new file mode 100644 index 000000000..62ddbf479 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/cjs_referrer/main.out @@ -0,0 +1,4 @@ +Download http://localhost:4260/@denotest%2fdual-cjs-esm +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +Initialize @denotest/dual-cjs-esm@1.0.0 +cjs diff --git a/tests/specs/npm/dual_cjs_esm/cjs_referrer/package.json b/tests/specs/npm/dual_cjs_esm/cjs_referrer/package.json new file mode 100644 index 000000000..e1b1e1a5f --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/cjs_referrer/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@denotest/dual-cjs-esm": "*" + } +} diff --git a/tests/specs/npm/dual_cjs_esm/esm_referrer/__test__.jsonc b/tests/specs/npm/dual_cjs_esm/esm_referrer/__test__.jsonc new file mode 100644 index 000000000..0ef147253 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/esm_referrer/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run -A --quiet main.ts", + "output": "main.out" +} diff --git a/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out b/tests/specs/npm/dual_cjs_esm/esm_referrer/main.out index 32e232f11..32e232f11 100644 --- a/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out +++ b/tests/specs/npm/dual_cjs_esm/esm_referrer/main.out diff --git a/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts b/tests/specs/npm/dual_cjs_esm/esm_referrer/main.ts index 4f3b79667..4f3b79667 100644 --- a/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts +++ b/tests/specs/npm/dual_cjs_esm/esm_referrer/main.ts diff --git a/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/__test__.jsonc b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/__test__.jsonc new file mode 100644 index 000000000..cf19217d1 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tempDir": true, + "tests": { + "check": { + "args": "check --node-modules-dir=auto main.ts", + "output": "check.out", + "exitCode": 1 + }, + "run": { + "args": "run --node-modules-dir=auto --allow-read main.ts", + "output": "main.out" + } + } +} diff --git a/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/check.out b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/check.out new file mode 100644 index 000000000..cbd7740a9 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/check.out @@ -0,0 +1,8 @@ +Download http://localhost:4260/@denotest%2fdual-cjs-esm +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +Initialize @denotest/dual-cjs-esm@1.0.0 +Check file:///[WILDLINE]/main.ts +error: TS2322 [ERROR]: Type '"cjs"' is not assignable to type '"other"'. +const kind: "other" = mod.getKind(); + ~~~~ + at file:///[WILDLINE]/main.ts:3:7 diff --git a/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/main.out b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/main.out new file mode 100644 index 000000000..62ddbf479 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/main.out @@ -0,0 +1,4 @@ +Download http://localhost:4260/@denotest%2fdual-cjs-esm +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +Initialize @denotest/dual-cjs-esm@1.0.0 +cjs diff --git a/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/main.ts b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/main.ts new file mode 100644 index 000000000..b8dd343f8 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/main.ts @@ -0,0 +1,4 @@ +import mod = require("@denotest/dual-cjs-esm"); + +const kind: "other" = mod.getKind(); +console.log(kind); diff --git a/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/package.json b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/package.json new file mode 100644 index 000000000..419d3d9f1 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/ts_referrer_type_cjs/package.json @@ -0,0 +1,6 @@ +{ + "type": "commonjs", + "dependencies": { + "@denotest/dual-cjs-esm": "*" + } +} diff --git a/tests/specs/npm/dynamic_npm_resolution_failure/main.out b/tests/specs/npm/dynamic_npm_resolution_failure/main.out index d9eb7182f..8888c4f0a 100644 --- a/tests/specs/npm/dynamic_npm_resolution_failure/main.out +++ b/tests/specs/npm/dynamic_npm_resolution_failure/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] Download http://localhost:4260/chalk -Download http://localhost:4260/@denotest/dep-cannot-parse +Download http://localhost:4260/@denotest%2fdep-cannot-parse [UNORDERED_END] Download http://localhost:4260/chalk/chalk-5.0.1.tgz Hi diff --git a/tests/specs/npm/esm_import_cjs_default/main.out b/tests/specs/npm/esm_import_cjs_default/main.out index ec7962e5a..6528a68d7 100644 --- a/tests/specs/npm/esm_import_cjs_default/main.out +++ b/tests/specs/npm/esm_import_cjs_default/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/esm-import-cjs-default -Download http://localhost:4260/@denotest/cjs-default-export +Download http://localhost:4260/@denotest%2fesm-import-cjs-default +Download http://localhost:4260/@denotest%2fcjs-default-export Download http://localhost:4260/@denotest/cjs-default-export/1.0.0.tgz Download http://localhost:4260/@denotest/esm-import-cjs-default/1.0.0.tgz [UNORDERED_END] diff --git a/tests/specs/npm/import_map/import_map/main.out b/tests/specs/npm/import_map/import_map/main.out index 05f313d4e..2698fb695 100644 --- a/tests/specs/npm/import_map/import_map/main.out +++ b/tests/specs/npm/import_map/import_map/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] Download http://localhost:4260/chalk -Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest%2fdual-cjs-esm [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz diff --git a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out index 70d1145a3..abfa41403 100644 --- a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out +++ b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json/imports_package_json/main.out b/tests/specs/npm/imports_package_json/imports_package_json/main.out index 979e35576..70d787b25 100644 --- a/tests/specs/npm/imports_package_json/imports_package_json/main.out +++ b/tests/specs/npm/imports_package_json/imports_package_json/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz hi bye diff --git a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out index 7c803f2bf..95524202a 100644 --- a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out +++ b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out index 70d1145a3..abfa41403 100644 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out index 979e35576..70d787b25 100644 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz hi bye diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out index 7c803f2bf..95524202a 100644 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out index 70d1145a3..abfa41403 100644 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out index 979e35576..70d787b25 100644 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz hi bye diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out index 7c803f2bf..95524202a 100644 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out index 137b9f8ce..2f7dde2d9 100644 --- a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out +++ b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out @@ -46,6 +46,16 @@ "size": 325, "mediaType": "JavaScript", "specifier": "[WILDCARD]/main.js" + }, + { + "kind": "npm", + "specifier": "npm:/chai@4.3.6", + "npmPackage": "chai@4.3.6" + }, + { + "kind": "npm", + "specifier": "npm:/chalk@4.1.2", + "npmPackage": "chalk@4.1.2" } ], "redirects": { @@ -58,12 +68,14 @@ "version": "4.3.0", "dependencies": [ "color-convert@2.0.1" - ] + ], + "registryUrl": "http://localhost:4260/" }, "assertion-error@1.1.0": { "name": "assertion-error", "version": "1.1.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "chai@4.3.6": { "name": "chai", @@ -76,7 +88,8 @@ "loupe@2.3.4", "pathval@1.1.1", "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "chalk@4.1.2": { "name": "chalk", @@ -84,65 +97,76 @@ "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "check-error@1.0.2": { "name": "check-error", "version": "1.0.2", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "color-convert@2.0.1": { "name": "color-convert", "version": "2.0.1", "dependencies": [ "color-name@1.1.4" - ] + ], + "registryUrl": "http://localhost:4260/" }, "color-name@1.1.4": { "name": "color-name", "version": "1.1.4", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "deep-eql@3.0.1": { "name": "deep-eql", "version": "3.0.1", "dependencies": [ "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "get-func-name@2.0.0": { "name": "get-func-name", "version": "2.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "has-flag@4.0.0": { "name": "has-flag", "version": "4.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "loupe@2.3.4": { "name": "loupe", "version": "2.3.4", "dependencies": [ "get-func-name@2.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "pathval@1.1.1": { "name": "pathval", "version": "1.1.1", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "supports-color@7.2.0": { "name": "supports-color", "version": "7.2.0", "dependencies": [ "has-flag@4.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "type-detect@4.0.8": { "name": "type-detect", "version": "4.0.8", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out index 137b9f8ce..2f7dde2d9 100644 --- a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out @@ -46,6 +46,16 @@ "size": 325, "mediaType": "JavaScript", "specifier": "[WILDCARD]/main.js" + }, + { + "kind": "npm", + "specifier": "npm:/chai@4.3.6", + "npmPackage": "chai@4.3.6" + }, + { + "kind": "npm", + "specifier": "npm:/chalk@4.1.2", + "npmPackage": "chalk@4.1.2" } ], "redirects": { @@ -58,12 +68,14 @@ "version": "4.3.0", "dependencies": [ "color-convert@2.0.1" - ] + ], + "registryUrl": "http://localhost:4260/" }, "assertion-error@1.1.0": { "name": "assertion-error", "version": "1.1.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "chai@4.3.6": { "name": "chai", @@ -76,7 +88,8 @@ "loupe@2.3.4", "pathval@1.1.1", "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "chalk@4.1.2": { "name": "chalk", @@ -84,65 +97,76 @@ "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "check-error@1.0.2": { "name": "check-error", "version": "1.0.2", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "color-convert@2.0.1": { "name": "color-convert", "version": "2.0.1", "dependencies": [ "color-name@1.1.4" - ] + ], + "registryUrl": "http://localhost:4260/" }, "color-name@1.1.4": { "name": "color-name", "version": "1.1.4", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "deep-eql@3.0.1": { "name": "deep-eql", "version": "3.0.1", "dependencies": [ "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "get-func-name@2.0.0": { "name": "get-func-name", "version": "2.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "has-flag@4.0.0": { "name": "has-flag", "version": "4.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "loupe@2.3.4": { "name": "loupe", "version": "2.3.4", "dependencies": [ "get-func-name@2.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "pathval@1.1.1": { "name": "pathval", "version": "1.1.1", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "supports-color@7.2.0": { "name": "supports-color", "version": "7.2.0", "dependencies": [ "has-flag@4.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "type-detect@4.0.8": { "name": "type-detect", "version": "4.0.8", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out index 21fc7edf1..fd2aa9ab0 100644 --- a/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out +++ b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out @@ -19,7 +19,8 @@ "version": "4.3.0", "dependencies": [ "color-convert@2.0.1" - ] + ], + "registryUrl": "http://localhost:4260/" }, "chalk@4.1.2": { "name": "chalk", @@ -27,31 +28,36 @@ "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "color-convert@2.0.1": { "name": "color-convert", "version": "2.0.1", "dependencies": [ "color-name@1.1.4" - ] + ], + "registryUrl": "http://localhost:4260/" }, "color-name@1.1.4": { "name": "color-name", "version": "1.1.4", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "has-flag@4.0.0": { "name": "has-flag", "version": "4.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "supports-color@7.2.0": { "name": "supports-color", "version": "7.2.0", "dependencies": [ "has-flag@4.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out index 3c133bcde..b7a583557 100644 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +Download http://localhost:4260/@denotest%2fpeer-dep-test-child +Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild +Download http://localhost:4260/@denotest%2fpeer-dep-test-peer [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out index 9c8145211..18d7f7865 100644 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +Download http://localhost:4260/@denotest%2fpeer-dep-test-child +Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild +Download http://localhost:4260/@denotest%2fpeer-dep-test-peer [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out index 3c133bcde..b7a583557 100644 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +Download http://localhost:4260/@denotest%2fpeer-dep-test-child +Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild +Download http://localhost:4260/@denotest%2fpeer-dep-test-peer [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out index 46cc35c65..2ee6268f5 100644 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out @@ -1,7 +1,7 @@ { "version": 1, "roots": [ - "[WILDCARD]/peer_deps_with_copied_folders/main.ts" + "file://[WILDCARD]/main.ts" ], "modules": [ { @@ -46,6 +46,16 @@ "size": 171, "mediaType": "TypeScript", "specifier": "file://[WILDCARD]/main.ts" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest/peer-dep-test-child@1.0.0", + "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest/peer-dep-test-child@2.0.0", + "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" } ], "redirects": { @@ -59,7 +69,8 @@ "dependencies": [ "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0", "@denotest/peer-dep-test-peer@1.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { "name": "@denotest/peer-dep-test-child", @@ -67,31 +78,36 @@ "dependencies": [ "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0", "@denotest/peer-dep-test-peer@2.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { "name": "@denotest/peer-dep-test-grandchild", "version": "1.0.0", "dependencies": [ "@denotest/peer-dep-test-peer@1.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0": { "name": "@denotest/peer-dep-test-grandchild", "version": "1.0.0", "dependencies": [ "@denotest/peer-dep-test-peer@2.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-peer@1.0.0": { "name": "@denotest/peer-dep-test-peer", "version": "1.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-peer@2.0.0": { "name": "@denotest/peer-dep-test-peer", "version": "2.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out index 9c8145211..18d7f7865 100644 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +Download http://localhost:4260/@denotest%2fpeer-dep-test-child +Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild +Download http://localhost:4260/@denotest%2fpeer-dep-test-peer [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz diff --git a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out index cdfdeabe2..645556b26 100644 --- a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out index 93b5a14cc..1b06bccb8 100644 --- a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out +++ b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz [UNORDERED_END] diff --git a/tests/specs/npm/lifecycle_scripts/conflicting_bin.out b/tests/specs/npm/lifecycle_scripts/conflicting_bin.out index bae5275dc..33282ee81 100644 --- a/tests/specs/npm/lifecycle_scripts/conflicting_bin.out +++ b/tests/specs/npm/lifecycle_scripts/conflicting_bin.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/better-say-hello -Download http://localhost:4260/@denotest/say-hello-on-install -Download http://localhost:4260/@denotest/say-hello +Download http://localhost:4260/@denotest%2fbetter-say-hello +Download http://localhost:4260/@denotest%2fsay-hello-on-install +Download http://localhost:4260/@denotest%2fsay-hello Download http://localhost:4260/@denotest/better-say-hello/1.0.0.tgz Download http://localhost:4260/@denotest/say-hello-on-install/1.0.0.tgz Download http://localhost:4260/@denotest/say-hello/1.0.0.tgz 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 09324c845..d72f3c8b2 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,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/npm/lifecycle_scripts/no_deno_json.out b/tests/specs/npm/lifecycle_scripts/no_deno_json.out index 8509d8f9f..1966396a3 100644 --- a/tests/specs/npm/lifecycle_scripts/no_deno_json.out +++ b/tests/specs/npm/lifecycle_scripts/no_deno_json.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/lifecycle-scripts-cjs -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2flifecycle-scripts-cjs +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/lifecycle-scripts-cjs/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/lifecycle-scripts-cjs@1.0.0 diff --git a/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out b/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out index 81577e6ba..339384f73 100644 --- a/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out +++ b/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out @@ -1,5 +1,5 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-addon-implicit-node-gyp +Download http://localhost:4260/@denotest%2fnode-addon-implicit-node-gyp Download http://localhost:4260/@denotest/node-addon-implicit-node-gyp/1.0.0.tgz Initialize @denotest/node-addon-implicit-node-gyp@1.0.0 Initialize @denotest/node-addon-implicit-node-gyp@1.0.0: running 'install' script diff --git a/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out b/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out index e0e51b26c..da5bb4f7b 100644 --- a/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/node-addon +Download http://localhost:4260/@denotest%2fnode-addon Download http://localhost:4260/node-gyp [WILDCARD] Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed: diff --git a/tests/specs/npm/lifecycle_scripts/only_warns_first1.out b/tests/specs/npm/lifecycle_scripts/only_warns_first1.out index cdfdeabe2..645556b26 100644 --- a/tests/specs/npm/lifecycle_scripts/only_warns_first1.out +++ b/tests/specs/npm/lifecycle_scripts/only_warns_first1.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/npm/lossy_utf8_module/main.out b/tests/specs/npm/lossy_utf8_module/main.out index 0e96f9ebb..d046d2ec5 100644 --- a/tests/specs/npm/lossy_utf8_module/main.out +++ b/tests/specs/npm/lossy_utf8_module/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/lossy-utf8-module +Download http://localhost:4260/@denotest%2flossy-utf8-module Download http://localhost:4260/@denotest/lossy-utf8-module/1.0.0.tgz ���� diff --git a/tests/specs/npm/lossy_utf8_package_json/main.out b/tests/specs/npm/lossy_utf8_package_json/main.out index 99aa5ab61..69f687039 100644 --- a/tests/specs/npm/lossy_utf8_package_json/main.out +++ b/tests/specs/npm/lossy_utf8_package_json/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/lossy-utf8-package-json +Download http://localhost:4260/@denotest%2flossy-utf8-package-json Download http://localhost:4260/@denotest/lossy-utf8-package-json/1.0.0.tgz hello diff --git a/tests/specs/npm/lossy_utf8_script/main.out b/tests/specs/npm/lossy_utf8_script/main.out index 180ecdf1c..0883392fd 100644 --- a/tests/specs/npm/lossy_utf8_script/main.out +++ b/tests/specs/npm/lossy_utf8_script/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/lossy-utf8-script +Download http://localhost:4260/@denotest%2flossy-utf8-script Download http://localhost:4260/@denotest/lossy-utf8-script/1.0.0.tgz ���� diff --git a/tests/specs/npm/lossy_utf8_script_from_cjs/main.out b/tests/specs/npm/lossy_utf8_script_from_cjs/main.out index 4f062a2ae..635ea5b3a 100644 --- a/tests/specs/npm/lossy_utf8_script_from_cjs/main.out +++ b/tests/specs/npm/lossy_utf8_script_from_cjs/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/lossy-utf8-script +Download http://localhost:4260/@denotest%2flossy-utf8-script Download http://localhost:4260/@denotest/lossy-utf8-script/1.0.0.tgz Initialize @denotest/lossy-utf8-script@1.0.0 ���� diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out index fdacea385..a1d3a6e2c 100644 --- a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +Download http://localhost:4260/@denotest%2fMixedCase +Download http://localhost:4260/@denotest%2fCAPITALS [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out index 6ab989d80..c8c9ed396 100644 --- a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +Download http://localhost:4260/@denotest%2fMixedCase +Download http://localhost:4260/@denotest%2fCAPITALS [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out index fdacea385..a1d3a6e2c 100644 --- a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out +++ b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +Download http://localhost:4260/@denotest%2fMixedCase +Download http://localhost:4260/@denotest%2fCAPITALS [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out index 6ab989d80..c8c9ed396 100644 --- a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out +++ b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +Download http://localhost:4260/@denotest%2fMixedCase +Download http://localhost:4260/@denotest%2fCAPITALS [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz diff --git a/tests/specs/npm/no_types_cjs/main.out b/tests/specs/npm/no_types_cjs/main.out index 4747a9a32..c993d5fbf 100644 --- a/tests/specs/npm/no_types_cjs/main.out +++ b/tests/specs/npm/no_types_cjs/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/no-types-cjs +Download http://localhost:4260/@denotest%2fno-types-cjs Download http://localhost:4260/@denotest/no-types-cjs/1.0.0.tgz Check file:///[WILDLINE]/no_types_cjs/main.ts diff --git a/tests/specs/npm/no_types_in_conditional_exports/main.out b/tests/specs/npm/no_types_in_conditional_exports/main.out index 46c583234..593cb2337 100644 --- a/tests/specs/npm/no_types_in_conditional_exports/main.out +++ b/tests/specs/npm/no_types_in_conditional_exports/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/no-types-in-conditional-exports +Download http://localhost:4260/@denotest%2fno-types-in-conditional-exports Download http://localhost:4260/@denotest/no-types-in-conditional-exports/1.0.0.tgz Check [WILDCARD]npm/no_types_in_conditional_exports/main.ts { foo: "bar" } diff --git a/tests/specs/npm/node_modules_import/install.out b/tests/specs/npm/node_modules_import/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/npm/node_modules_import/install.out +++ b/tests/specs/npm/node_modules_import/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/npm/node_modules_import_auto/main.out b/tests/specs/npm/node_modules_import_auto/main.out index 8fda5cda1..18194e3a0 100644 --- a/tests/specs/npm/node_modules_import_auto/main.out +++ b/tests/specs/npm/node_modules_import_auto/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 2 diff --git a/tests/specs/npm/node_modules_import_auto/main_check.out b/tests/specs/npm/node_modules_import_auto/main_check.out index 24249f357..093b0c051 100644 --- a/tests/specs/npm/node_modules_import_auto/main_check.out +++ b/tests/specs/npm/node_modules_import_auto/main_check.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file:///[WILDCARD]/main.ts diff --git a/tests/specs/npm/non_existent_dep/__test__.jsonc b/tests/specs/npm/non_existent_dep/__test__.jsonc index bc3841419..8608e00f3 100644 --- a/tests/specs/npm/non_existent_dep/__test__.jsonc +++ b/tests/specs/npm/non_existent_dep/__test__.jsonc @@ -1,5 +1,5 @@ { "args": "cache npm:@denotest/non-existent-dep", "exitCode": 1, - "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep\nDownload http://localhost:4260/@denotest/non-existent\n[UNORDERED_END]\nerror: npm package '@denotest/non-existent' does not exist.\n" + "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest%2fnon-existent-dep\nDownload http://localhost:4260/@denotest%2fnon-existent\n[UNORDERED_END]\nerror: npm package '@denotest/non-existent' does not exist.\n" } diff --git a/tests/specs/npm/non_existent_dep_version/__test__.jsonc b/tests/specs/npm/non_existent_dep_version/__test__.jsonc index 4bc084ce3..dd91c6624 100644 --- a/tests/specs/npm/non_existent_dep_version/__test__.jsonc +++ b/tests/specs/npm/non_existent_dep_version/__test__.jsonc @@ -1,5 +1,5 @@ { "args": "cache npm:@denotest/non-existent-dep-version", "exitCode": 1, - "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep-version\nDownload http://localhost:4260/@denotest/esm-basic\n[UNORDERED_END]\nerror: Could not find npm package '@denotest/esm-basic' matching '=99.99.99'.\n" + "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest%2fnon-existent-dep-version\nDownload http://localhost:4260/@denotest%2fesm-basic\n[UNORDERED_END]\nerror: Could not find npm package '@denotest/esm-basic' matching '=99.99.99'.\n" } diff --git a/tests/specs/npm/npmrc/__test__.jsonc b/tests/specs/npm/npmrc/__test__.jsonc index e7588a779..88ef2d810 100644 --- a/tests/specs/npm/npmrc/__test__.jsonc +++ b/tests/specs/npm/npmrc/__test__.jsonc @@ -13,6 +13,10 @@ "run_node_modules_dir": { "args": "run --node-modules-dir=auto -A --quiet main.js", "output": "main.out" + }, + "info": { + "args": "info --node-modules-dir=auto --json main.js", + "output": "info.out" } } } diff --git a/tests/specs/npm/npmrc/info.out b/tests/specs/npm/npmrc/info.out new file mode 100644 index 000000000..ee9aa9ee9 --- /dev/null +++ b/tests/specs/npm/npmrc/info.out @@ -0,0 +1,87 @@ +[UNORDERED_START] +Download http://localhost:4262/@denotest2%2fbasic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4261/@denotest/basic/1.0.0.tgz +Download http://localhost:4262/@denotest2/basic/1.0.0.tgz +[UNORDERED_END] +[UNORDERED_START] +Initialize @denotest/basic@1.0.0 +Initialize @denotest2/basic@1.0.0 +[UNORDERED_END] +{ + "version": 1, + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "@denotest/basic", + "code": { + "specifier": "npm:@denotest/basic@1.0.0", + "span": { + "start": { + "line": 0, + "character": 35 + }, + "end": { + "line": 0, + "character": 52 + } + } + } + }, + { + "specifier": "@denotest2/basic", + "code": { + "specifier": "npm:@denotest2/basic@1.0.0", + "span": { + "start": { + "line": 1, + "character": 22 + }, + "end": { + "line": 1, + "character": 40 + } + } + } + } + ], + "local": "[WILDCARD]main.js", + "size": 192, + "mediaType": "JavaScript", + "specifier": "file://[WILDCARD]/main.js" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest/basic@1.0.0", + "npmPackage": "@denotest/basic@1.0.0" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest2/basic@1.0.0", + "npmPackage": "@denotest2/basic@1.0.0" + } + ], + "redirects": { + "npm:@denotest/basic@1.0.0": "npm:/@denotest/basic@1.0.0", + "npm:@denotest2/basic@1.0.0": "npm:/@denotest2/basic@1.0.0" + }, + "npmPackages": { + "@denotest/basic@1.0.0": { + "name": "@denotest/basic", + "version": "1.0.0", + "dependencies": [], + "registryUrl": "http://localhost:4261/" + }, + "@denotest2/basic@1.0.0": { + "name": "@denotest2/basic", + "version": "1.0.0", + "dependencies": [], + "registryUrl": "http://localhost:4262/" + } + } +} diff --git a/tests/specs/npm/npmrc/install.out b/tests/specs/npm/npmrc/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc/install.out +++ b/tests/specs/npm/npmrc/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_bad_registry_config/main.out b/tests/specs/npm/npmrc_bad_registry_config/main.out index 990d4a47f..5d778d32e 100644 --- a/tests/specs/npm/npmrc_bad_registry_config/main.out +++ b/tests/specs/npm/npmrc_bad_registry_config/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4261/@denotest/basic -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Bad response: 401 +Download http://localhost:4261/@denotest%2fbasic +error: Error getting response at http://localhost:4261/@denotest%2fbasic 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 990d4a47f..5d778d32e 100644 --- a/tests/specs/npm/npmrc_bad_token/main.out +++ b/tests/specs/npm/npmrc_bad_token/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4261/@denotest/basic -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Bad response: 401 +Download http://localhost:4261/@denotest%2fbasic +error: Error getting response at http://localhost:4261/@denotest%2fbasic 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 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc_basic_auth/install.out +++ b/tests/specs/npm/npmrc_basic_auth/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_deno_json/main.out b/tests/specs/npm/npmrc_deno_json/main.out index 62750088b..c3d6be8a1 100644 --- a/tests/specs/npm/npmrc_deno_json/main.out +++ b/tests/specs/npm/npmrc_deno_json/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4261/@denotest/basic +Download http://localhost:4261/@denotest%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz 0 42 diff --git a/tests/specs/npm/npmrc_homedir/install.out b/tests/specs/npm/npmrc_homedir/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc_homedir/install.out +++ b/tests/specs/npm/npmrc_homedir/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_install_arg/.npmrc b/tests/specs/npm/npmrc_install_arg/.npmrc new file mode 100644 index 000000000..de3704b92 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/.npmrc @@ -0,0 +1,2 @@ +@denotest:registry=http://localhost:4261/ +//localhost:4261/:_authToken=private-reg-token diff --git a/tests/specs/npm/npmrc_install_arg/__test__.jsonc b/tests/specs/npm/npmrc_install_arg/__test__.jsonc new file mode 100644 index 000000000..f34cfe116 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/__test__.jsonc @@ -0,0 +1,23 @@ +{ + "tempDir": true, + "tests": { + "deno_install_add": { + "steps": [{ + "args": "install npm:@denotest/basic", + "output": "install.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + }, + "deno_add": { + "steps": [{ + "args": "add npm:@denotest/basic", + "output": "add.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + } + } +} diff --git a/tests/specs/npm/npmrc_install_arg/add.out b/tests/specs/npm/npmrc_install_arg/add.out new file mode 100644 index 000000000..11948e54d --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/add.out @@ -0,0 +1,4 @@ +Add npm:@denotest/basic@1.0.0 +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4261/@denotest/basic/1.0.0.tgz +Initialize @denotest/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_install_arg/install.out b/tests/specs/npm/npmrc_install_arg/install.out new file mode 100644 index 000000000..11948e54d --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/install.out @@ -0,0 +1,4 @@ +Add npm:@denotest/basic@1.0.0 +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4261/@denotest/basic/1.0.0.tgz +Initialize @denotest/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_install_arg/main.js b/tests/specs/npm/npmrc_install_arg/main.js new file mode 100644 index 000000000..e8ccf7611 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_install_arg/main.out b/tests/specs/npm/npmrc_install_arg/main.out new file mode 100644 index 000000000..dcd912c89 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/main.out @@ -0,0 +1,2 @@ +0 +42 diff --git a/tests/specs/npm/npmrc_install_arg/package.json b/tests/specs/npm/npmrc_install_arg/package.json new file mode 100644 index 000000000..c1318b361 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/package.json @@ -0,0 +1,5 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": {} +} diff --git a/tests/specs/npm/npmrc_no_auth/.npmrc b/tests/specs/npm/npmrc_no_auth/.npmrc new file mode 100644 index 000000000..860a7c3d9 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/.npmrc @@ -0,0 +1 @@ +@denotest3:registry=http://localhost:4263/ diff --git a/tests/specs/npm/npmrc_no_auth/__test__.jsonc b/tests/specs/npm/npmrc_no_auth/__test__.jsonc new file mode 100644 index 000000000..efd04f0e4 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/__test__.jsonc @@ -0,0 +1,23 @@ +{ + "tempDir": true, + "tests": { + "deno_install_arg": { + "steps": [{ + "args": "install npm:@denotest3/basic", + "output": "install.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + }, + "deno_add_arg": { + "steps": [{ + "args": "add npm:@denotest3/basic", + "output": "add.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + } + } +} diff --git a/tests/specs/npm/npmrc_no_auth/add.out b/tests/specs/npm/npmrc_no_auth/add.out new file mode 100644 index 000000000..31b34da13 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/add.out @@ -0,0 +1,4 @@ +Add npm:@denotest3/basic@1.0.0 +Download http://localhost:4263/@denotest3%2fbasic +Download http://localhost:4263/@denotest3/basic/1.0.0.tgz +Initialize @denotest3/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_no_auth/install.out b/tests/specs/npm/npmrc_no_auth/install.out new file mode 100644 index 000000000..31b34da13 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/install.out @@ -0,0 +1,4 @@ +Add npm:@denotest3/basic@1.0.0 +Download http://localhost:4263/@denotest3%2fbasic +Download http://localhost:4263/@denotest3/basic/1.0.0.tgz +Initialize @denotest3/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_no_auth/main.js b/tests/specs/npm/npmrc_no_auth/main.js new file mode 100644 index 000000000..22713bb0d --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest3/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_no_auth/main.out b/tests/specs/npm/npmrc_no_auth/main.out new file mode 100644 index 000000000..dcd912c89 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/main.out @@ -0,0 +1,2 @@ +0 +42 diff --git a/tests/specs/npm/npmrc_no_auth/package.json b/tests/specs/npm/npmrc_no_auth/package.json new file mode 100644 index 000000000..dddaaac46 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/package.json @@ -0,0 +1,6 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": { + } +} diff --git a/tests/specs/npm/npmrc_no_auth_install/.npmrc b/tests/specs/npm/npmrc_no_auth_install/.npmrc new file mode 100644 index 000000000..860a7c3d9 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/.npmrc @@ -0,0 +1 @@ +@denotest3:registry=http://localhost:4263/ diff --git a/tests/specs/npm/npmrc_no_auth_install/__test__.jsonc b/tests/specs/npm/npmrc_no_auth_install/__test__.jsonc new file mode 100644 index 000000000..56a598e3b --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tempDir": true, + "tests": { + "deno_install_arg": { + "steps": [{ + "args": "install", + "output": "install.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + } + } +} diff --git a/tests/specs/npm/npmrc_no_auth_install/install.out b/tests/specs/npm/npmrc_no_auth_install/install.out new file mode 100644 index 000000000..b82747af7 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/install.out @@ -0,0 +1,3 @@ +Download http://localhost:4263/@denotest3%2fbasic +Download http://localhost:4263/@denotest3/basic/1.0.0.tgz +Initialize @denotest3/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_no_auth_install/main.js b/tests/specs/npm/npmrc_no_auth_install/main.js new file mode 100644 index 000000000..22713bb0d --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest3/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_no_auth_install/main.out b/tests/specs/npm/npmrc_no_auth_install/main.out new file mode 100644 index 000000000..dcd912c89 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/main.out @@ -0,0 +1,2 @@ +0 +42 diff --git a/tests/specs/npm/npmrc_no_auth_install/package.json b/tests/specs/npm/npmrc_no_auth_install/package.json new file mode 100644 index 000000000..2d4fb15ba --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/package.json @@ -0,0 +1,7 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": { + "@denotest3/basic": "1.0.0" + } +} diff --git a/tests/specs/npm/npmrc_not_next_to_package_json/main.out b/tests/specs/npm/npmrc_not_next_to_package_json/main.out index b583868ff..b128959a7 100644 --- a/tests/specs/npm/npmrc_not_next_to_package_json/main.out +++ b/tests/specs/npm/npmrc_not_next_to_package_json/main.out @@ -2,7 +2,7 @@ [# that serves the same packages. The important bit is the message below.] [WILDCARD] No .npmrc file found [WILDCARD] -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic [WILDCARD] Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz [WILDCARD] diff --git a/tests/specs/npm/npmrc_password_no_username/install.out b/tests/specs/npm/npmrc_password_no_username/install.out index d49a2ba0d..b198bcd27 100644 --- a/tests/specs/npm/npmrc_password_no_username/install.out +++ b/tests/specs/npm/npmrc_password_no_username/install.out @@ -1,3 +1,3 @@ [UNORDERED_START] -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Both the username and password must be provided for basic auth +error: Error getting response at http://localhost:4261/@denotest%2fbasic for package "@denotest/basic": Both the username and password must be provided for basic auth [UNORDERED_END] diff --git a/tests/specs/npm/npmrc_tarball_other_server/fail/main.out b/tests/specs/npm/npmrc_tarball_other_server/fail/main.out index 08a84a477..2c68dba54 100644 --- a/tests/specs/npm/npmrc_tarball_other_server/fail/main.out +++ b/tests/specs/npm/npmrc_tarball_other_server/fail/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4261/@denotest/tarballs-privateserver2 +Download http://localhost:4261/@denotest%2ftarballs-privateserver2 Download http://localhost:4262/@denotest/tarballs-privateserver2/1.0.0.tgz error: Failed caching npm package '@denotest/tarballs-privateserver2@1.0.0'. diff --git a/tests/specs/npm/npmrc_tarball_other_server/success/main.out b/tests/specs/npm/npmrc_tarball_other_server/success/main.out index d75f26e33..5322a1a17 100644 --- a/tests/specs/npm/npmrc_tarball_other_server/success/main.out +++ b/tests/specs/npm/npmrc_tarball_other_server/success/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4261/@denotest/tarballs-privateserver2 +Download http://localhost:4261/@denotest%2ftarballs-privateserver2 Download http://localhost:4262/@denotest/tarballs-privateserver2/1.0.0.tgz [# This fails on a checksum issue, because the test server isn't smart enough] [# to serve proper checksums for a package at another registry. That's fine] diff --git a/tests/specs/npm/npmrc_username_no_password/install.out b/tests/specs/npm/npmrc_username_no_password/install.out index d49a2ba0d..b198bcd27 100644 --- a/tests/specs/npm/npmrc_username_no_password/install.out +++ b/tests/specs/npm/npmrc_username_no_password/install.out @@ -1,3 +1,3 @@ [UNORDERED_START] -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Both the username and password must be provided for basic auth +error: Error getting response at http://localhost:4261/@denotest%2fbasic for package "@denotest/basic": Both the username and password must be provided for basic auth [UNORDERED_END] diff --git a/tests/specs/npm/npmrc_username_password/.npmrc b/tests/specs/npm/npmrc_username_password/.npmrc index c318678ae..9e1ded96a 100644 --- a/tests/specs/npm/npmrc_username_password/.npmrc +++ b/tests/specs/npm/npmrc_username_password/.npmrc @@ -1,6 +1,8 @@ @denotest:registry=http://localhost:4261/ //localhost:4261/:username=deno -//localhost:4261/:_password=land +# base64 of land +//localhost:4261/:_password=bGFuZA== @denotest2:registry=http://localhost:4262/ //localhost:4262/:username=deno -//localhost:4262/:_password=land2 +# base64 of land2 +//localhost:4262/:_password=bGFuZDI= diff --git a/tests/specs/npm/npmrc_username_password/install.out b/tests/specs/npm/npmrc_username_password/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc_username_password/install.out +++ b/tests/specs/npm/npmrc_username_password/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/permissions_outside_package/__test__.jsonc b/tests/specs/npm/permissions_outside_package/__test__.jsonc index 56228296b..d5f6bf490 100644 --- a/tests/specs/npm/permissions_outside_package/__test__.jsonc +++ b/tests/specs/npm/permissions_outside_package/__test__.jsonc @@ -1,4 +1,5 @@ { - "args": "run --allow-read permissions_outside_package/main.ts", - "output": "permissions_outside_package/main.out" + "tempDir": true, + "args": "run --allow-read --node-modules-dir=none main.ts", + "output": "main.out" } diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js b/tests/specs/npm/permissions_outside_package/foo/config.js index e667790d2..e667790d2 100644 --- a/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js +++ b/tests/specs/npm/permissions_outside_package/foo/config.js diff --git a/tests/specs/npm/permissions_outside_package/foo/package.json b/tests/specs/npm/permissions_outside_package/foo/package.json new file mode 100644 index 000000000..95b43077e --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/foo/package.json @@ -0,0 +1,5 @@ +{ + "name": "foobar", + "version": "0.0.1", + "type": "commonjs" +} diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out b/tests/specs/npm/permissions_outside_package/main.out index 089f329c4..0fde8cf87 100644 --- a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out +++ b/tests/specs/npm/permissions_outside_package/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/permissions-outside-package +Download http://localhost:4260/@denotest%2fpermissions-outside-package Download http://localhost:4260/@denotest/permissions-outside-package/1.0.0.tgz { name: "foobar", version: "0.0.1" } diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts b/tests/specs/npm/permissions_outside_package/main.ts index 934a3eebc..a80713fa7 100644 --- a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts +++ b/tests/specs/npm/permissions_outside_package/main.ts @@ -1,5 +1,5 @@ import { loadConfigFile } from "npm:@denotest/permissions-outside-package"; -const fileName = `${Deno.cwd()}/permissions_outside_package/foo/config.js`; +const fileName = `${Deno.cwd()}/foo/config.js`; const config = loadConfigFile(fileName); console.log(config); diff --git a/tests/specs/npm/permissions_outside_package/package.json b/tests/specs/npm/permissions_outside_package/package.json new file mode 100644 index 000000000..2c63c0851 --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/package.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json deleted file mode 100644 index cc049e6ce..000000000 --- a/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foobar", - "version": "0.0.1" -} diff --git a/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out b/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out index 3cc8a8279..2e82e6802 100644 --- a/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out +++ b/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/esm-basic -Download http://localhost:4260/@denotest/require-resolve +Download http://localhost:4260/@denotest%2fesm-basic +Download http://localhost:4260/@denotest%2frequire-resolve [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/npm/require_type_commonjs/__test__.jsonc b/tests/specs/npm/require_type_commonjs/__test__.jsonc index c9ba97ff5..a71173ce3 100644 --- a/tests/specs/npm/require_type_commonjs/__test__.jsonc +++ b/tests/specs/npm/require_type_commonjs/__test__.jsonc @@ -1,5 +1,4 @@ { "args": "run --allow-read --quiet main.ts", - "output": "main.out", - "exitCode": 1 + "output": "main.out" } diff --git a/tests/specs/npm/require_type_commonjs/main.out b/tests/specs/npm/require_type_commonjs/main.out index d715db8a9..00750edc0 100644 --- a/tests/specs/npm/require_type_commonjs/main.out +++ b/tests/specs/npm/require_type_commonjs/main.out @@ -1,4 +1 @@ -error: 'import', and 'export' cannot be used outside of module code at file://[WILDCARD]/@denotest/type-commonjs/1.0.0/index.js:1:1 - - export {}; - ~~~~~~ +3 diff --git a/tests/specs/npm/require_type_commonjs/main.ts b/tests/specs/npm/require_type_commonjs/main.ts index 243eb216e..95ec6099e 100644 --- a/tests/specs/npm/require_type_commonjs/main.ts +++ b/tests/specs/npm/require_type_commonjs/main.ts @@ -1 +1,2 @@ -import "npm:@denotest/type-commonjs"; +import { add } from "npm:@denotest/type-commonjs"; +console.log(add(1, 2)); diff --git a/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out index ccfd35bc8..2a82194e3 100644 --- a/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out +++ b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/reserved-word-exports +Download http://localhost:4260/@denotest%2freserved-word-exports Download http://localhost:4260/@denotest/reserved-word-exports/1.0.0.tgz [Module: null prototype] { abstract: "abstract", diff --git a/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out index f6ee03ef1..a473c32cc 100644 --- a/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out +++ b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/bin@1.0.0 dev diff --git a/tests/specs/npm/specifier_two_slashes/__test__.jsonc b/tests/specs/npm/specifier_two_slashes/__test__.jsonc new file mode 100644 index 000000000..bddbdbc1c --- /dev/null +++ b/tests/specs/npm/specifier_two_slashes/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet main.ts", + "output": "3\n" +} diff --git a/tests/specs/npm/specifier_two_slashes/main.ts b/tests/specs/npm/specifier_two_slashes/main.ts new file mode 100644 index 000000000..ef1adceb5 --- /dev/null +++ b/tests/specs/npm/specifier_two_slashes/main.ts @@ -0,0 +1,3 @@ +import { add } from "npm:@denotest/specifier-two-slashes"; + +console.log(add(1, 2)); diff --git a/tests/specs/npm/types_d_ext/d_ext/main.out b/tests/specs/npm/types_d_ext/d_ext/main.out index e99df6696..5a834fbeb 100644 --- a/tests/specs/npm/types_d_ext/d_ext/main.out +++ b/tests/specs/npm/types_d_ext/d_ext/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/d-ext +Download http://localhost:4260/@denotest%2fd-ext Download http://localhost:4260/@denotest/d-ext/1.0.0.tgz Check file:///[WILDCARD]/d_ext/main.ts diff --git a/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out index 017a17ea2..62ef51d9f 100644 --- a/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out +++ b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/types-entry-value-not-exists +Download http://localhost:4260/@denotest%2ftypes-entry-value-not-exists Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz Check file://[WILDCARD]/types_entry_value_not_exists/main.ts error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. diff --git a/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out index 10f9425ca..bb69bf86f 100644 --- a/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out +++ b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/types-exports-import-types +Download http://localhost:4260/@denotest%2ftypes-exports-import-types Download http://localhost:4260/@denotest/types-exports-import-types/1.0.0.tgz Check file://[WILDCARD]/types_exports_import_types/main.ts error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. diff --git a/tests/specs/npm/types_general/main.out b/tests/specs/npm/types_general/main.out index ffba4f84d..edc83f2a2 100644 --- a/tests/specs/npm/types_general/main.out +++ b/tests/specs/npm/types_general/main.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/types -Download http://localhost:4260/@denotest/types_imported -Download http://localhost:4260/@denotest/types-exports-subpaths +Download http://localhost:4260/@denotest%2ftypes +Download http://localhost:4260/@denotest%2ftypes_imported +Download http://localhost:4260/@denotest%2ftypes-exports-subpaths Download http://localhost:4260/@denotest/types_imported/1.0.0.tgz Download http://localhost:4260/@denotest/types-exports-subpaths/1.0.0.tgz Download http://localhost:4260/@denotest/types/1.0.0.tgz diff --git a/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out index 53e872eaf..c867253ad 100644 --- a/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out +++ b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/types-no-types-entry -Download http://localhost:4260/@denotest/types-entry-value-not-exists +Download http://localhost:4260/@denotest%2ftypes-no-types-entry +Download http://localhost:4260/@denotest%2ftypes-entry-value-not-exists [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz diff --git a/tests/specs/npm/typescript_file_in_package/__test__.jsonc b/tests/specs/npm/typescript_file_in_package/__test__.jsonc index 08979ed25..7b5c5e1b6 100644 --- a/tests/specs/npm/typescript_file_in_package/__test__.jsonc +++ b/tests/specs/npm/typescript_file_in_package/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run typescript_file_in_package/main.ts", - "output": "typescript_file_in_package/main.out", + "args": "run main.ts", + "output": "main.out", "exitCode": 1 } diff --git a/tests/specs/npm/typescript_file_in_package/main.out b/tests/specs/npm/typescript_file_in_package/main.out new file mode 100644 index 000000000..58290a873 --- /dev/null +++ b/tests/specs/npm/typescript_file_in_package/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest%2ftypescript-file +Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz +error: TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts b/tests/specs/npm/typescript_file_in_package/main.ts index aefc38ebe..aefc38ebe 100644 --- a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts +++ b/tests/specs/npm/typescript_file_in_package/main.ts diff --git a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out deleted file mode 100644 index 3c3b97190..000000000 --- a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest/typescript-file -Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz -error: Could not resolve 'npm:@denotest/typescript-file@1.0.0'. - -Caused by: - TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/specs/npm/typo_in_npm/__test__.jsonc b/tests/specs/npm/typo_in_npm/__test__.jsonc new file mode 100644 index 000000000..03023c9e7 --- /dev/null +++ b/tests/specs/npm/typo_in_npm/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run np:cowsay", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/npm/typo_in_npm/main.out b/tests/specs/npm/typo_in_npm/main.out new file mode 100644 index 000000000..19f17b1d0 --- /dev/null +++ b/tests/specs/npm/typo_in_npm/main.out @@ -0,0 +1,8 @@ +error: Unsupported scheme "np" for module "np:cowsay". Supported schemes: + - "blob" + - "data" + - "file" + - "http" + - "https" + - "jsr" + - "npm" diff --git a/tests/specs/npm/user_agent_env_var/__test__.jsonc b/tests/specs/npm/user_agent_env_var/__test__.jsonc new file mode 100644 index 000000000..a2af970a0 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/__test__.jsonc @@ -0,0 +1,46 @@ +{ + "tempDir": true, + "tests": { + "set_for_npm_package": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "run -A npm:@denotest/print-npm-user-agent", + "output": "run.out" + } + ] + }, + "unset_for_local_file": { + "steps": [ + { + "args": "run -A main.ts", + "output": "Download [WILDCARD]\nnpm_config_user_agent: undefined\n" + } + ] + }, + "set_for_tasks": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "task run-via-bin", + "output": "bin_command.out" + } + ] + }, + "set_for_lifecycle_scripts": { + "steps": [ + { + "args": "install --allow-scripts", + "output": "postinstall.out", + "exitCode": 1 + } + ] + } + } +} diff --git a/tests/specs/npm/user_agent_env_var/bin_command.out b/tests/specs/npm/user_agent_env_var/bin_command.out new file mode 100644 index 000000000..c8e941303 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/bin_command.out @@ -0,0 +1,2 @@ +Task run-via-bin print-npm-user-agent +npm_config_user_agent: deno/[WILDCARD] npm/? deno/[WILDCARD] [WILDCARD] [WILDCARD] diff --git a/tests/specs/npm/user_agent_env_var/deno.jsonc b/tests/specs/npm/user_agent_env_var/deno.jsonc new file mode 100644 index 000000000..fbd70ec48 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/deno.jsonc @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "auto" +} diff --git a/tests/specs/npm/user_agent_env_var/main.ts b/tests/specs/npm/user_agent_env_var/main.ts new file mode 100644 index 000000000..2c51107e3 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/main.ts @@ -0,0 +1 @@ +console.log(`npm_config_user_agent: ${Deno.env.get("npm_config_user_agent")}`); diff --git a/tests/specs/npm/user_agent_env_var/package.json b/tests/specs/npm/user_agent_env_var/package.json new file mode 100644 index 000000000..12cc0cc6f --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "run-via-bin": "print-npm-user-agent" + }, + "dependencies": { + "@denotest/print-npm-user-agent": "1.0.0" + } +} diff --git a/tests/specs/npm/user_agent_env_var/postinstall.out b/tests/specs/npm/user_agent_env_var/postinstall.out new file mode 100644 index 000000000..19a08598f --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/postinstall.out @@ -0,0 +1,10 @@ +Download http://localhost:4260/@denotest%2fprint-npm-user-agent +Download http://localhost:4260/@denotest/print-npm-user-agent/1.0.0.tgz +Initialize @denotest/print-npm-user-agent@1.0.0 +Initialize @denotest/print-npm-user-agent@1.0.0: running 'postinstall' script +error: script 'postinstall' in '@denotest/print-npm-user-agent@1.0.0' failed with exit code 1 +stdout: +postinstall +npm_config_user_agent: deno/[WILDCARD] npm/? deno/[WILDCARD] [WILDCARD] [WILDCARD] + +error: failed to run scripts for packages: @denotest/print-npm-user-agent@1.0.0 diff --git a/tests/specs/npm/user_agent_env_var/run.out b/tests/specs/npm/user_agent_env_var/run.out new file mode 100644 index 000000000..a630ac412 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/run.out @@ -0,0 +1 @@ +npm_config_user_agent: deno/[WILDCARD] npm/? deno/[WILDCARD] [WILDCARD] [WILDCARD] diff --git a/tests/specs/npm/user_agent_env_var/test.mjs b/tests/specs/npm/user_agent_env_var/test.mjs new file mode 100644 index 000000000..ae035d40e --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/test.mjs @@ -0,0 +1 @@ +console.log(process.env.npm_config_user_agent); diff --git a/tests/specs/npm/workspace_basic/__test__.jsonc b/tests/specs/npm/workspace_basic/__test__.jsonc index 8ecde6887..45e414564 100644 --- a/tests/specs/npm/workspace_basic/__test__.jsonc +++ b/tests/specs/npm/workspace_basic/__test__.jsonc @@ -23,18 +23,24 @@ }] }, "exports_sub_path_not_exists": { - // TODO(2.0): this test appears legitimately broken - "ignore": true, - "args": "run b/exports-sub-path-not-exists.ts", - "output": "b/exports-sub-path-not-exists.out", - "exitCode": 1 + "steps": [{ + "args": "install", + "output": "[WILDCARD]" + }, { + "args": "run b/exports-sub-path-not-exists.ts", + "output": "b/exports-sub-path-not-exists.out", + "exitCode": 1 + }] }, "no_exports_sub_path_not_exists": { - // TODO(2.0): this test appears legitimately broken - "ignore": true, - "args": "run b/no-exports-sub-path-not-exists.ts", - "output": "b/no-exports-sub-path-not-exists.out", - "exitCode": 1 + "steps": [{ + "args": "install", + "output": "[WILDCARD]" + }, { + "args": "run b/no-exports-sub-path-not-exists.ts", + "output": "b/no-exports-sub-path-not-exists.out", + "exitCode": 1 + }] } } } diff --git a/tests/specs/npm/workspace_basic/b/main_global_cache.out b/tests/specs/npm/workspace_basic/b/main_global_cache.out index 203ac5a99..879f6ab05 100644 --- a/tests/specs/npm/workspace_basic/b/main_global_cache.out +++ b/tests/specs/npm/workspace_basic/b/main_global_cache.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Hello 5 Hello 5 diff --git a/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out b/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out index eeb455652..464c05c57 100644 --- a/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out +++ b/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Hello 5 diff --git a/tests/specs/npm/workspace_basic/b/no-exports-sub-path-not-exists.out b/tests/specs/npm/workspace_basic/b/no-exports-sub-path-not-exists.out index f98aa34cb..a2ae57dfe 100644 --- a/tests/specs/npm/workspace_basic/b/no-exports-sub-path-not-exists.out +++ b/tests/specs/npm/workspace_basic/b/no-exports-sub-path-not-exists.out @@ -1,3 +1,3 @@ [# not the best error, but it did resolve because there was no exports specified] -error: Module not found "file:///[WILDLINE]/c/non-existent". +error: [ERR_MODULE_NOT_FOUND] Cannot find module 'file:///[WILDLINE]/c/non-existent' imported from 'file:///[WILDLINE]/b/no-exports-sub-path-not-exists.ts' at file:///[WILDLINE]/b/no-exports-sub-path-not-exists.ts:1:20 diff --git a/tests/specs/npm/workspace_basic/main.out b/tests/specs/npm/workspace_basic/main.out index 92404af87..52d8267bb 100644 --- a/tests/specs/npm/workspace_basic/main.out +++ b/tests/specs/npm/workspace_basic/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Hello 5 C: Hi! diff --git a/tests/specs/npm/workspace_sub_deno_json/__test__.jsonc b/tests/specs/npm/workspace_sub_deno_json/__test__.jsonc index dbf35dcb0..03c566962 100644 --- a/tests/specs/npm/workspace_sub_deno_json/__test__.jsonc +++ b/tests/specs/npm/workspace_sub_deno_json/__test__.jsonc @@ -2,15 +2,11 @@ "tempDir": true, "tests": { "member": { - // TODO(2.0): this test appears legitimately broken - "ignore": true, - "args": "run --allow-read member/main.ts", + "args": "run --allow-read --node-modules-dir=auto member/main.ts", "output": "member.out" }, "member_with_deno_json": { - // TODO(2.0): this test appears legitimately broken - "ignore": true, - "args": "run --allow-read member_with_deno_json/main.ts", + "args": "run --allow-read --node-modules-dir=auto member_with_deno_json/main.ts", "output": "member.out" }, "non_member": { diff --git a/tests/specs/npm/workspace_sub_deno_json/member_with_deno_json/deno.jsonc b/tests/specs/npm/workspace_sub_deno_json/member_with_deno_json/deno.jsonc index e246bc65d..b80ded2b1 100644 --- a/tests/specs/npm/workspace_sub_deno_json/member_with_deno_json/deno.jsonc +++ b/tests/specs/npm/workspace_sub_deno_json/member_with_deno_json/deno.jsonc @@ -1,4 +1,4 @@ { // will cause a warning - "nodeModules": "local-auto" + "nodeModulesDir": "auto" } |