diff options
Diffstat (limited to 'cli/tests')
17 files changed, 84 insertions, 79 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index 107bab613..3d21b57c3 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -581,7 +581,7 @@ fn no_npm_after_first_run() { let stdout = String::from_utf8_lossy(&output.stdout); assert_contains!( stderr, - "Following npm specifiers were requested: \"chalk@5\"; but --no-npm is specified." + "error: npm specifiers were requested; but --no-npm is specified\n at file:///" ); assert!(stdout.is_empty()); assert!(!output.status.success()); @@ -623,7 +623,7 @@ fn no_npm_after_first_run() { let stdout = String::from_utf8_lossy(&output.stdout); assert_contains!( stderr, - "Following npm specifiers were requested: \"chalk@5\"; but --no-npm is specified." + "error: npm specifiers were requested; but --no-npm is specified\n at file:///" ); assert!(stdout.is_empty()); assert!(!output.status.success()); @@ -820,7 +820,7 @@ fn ensure_registry_files_local() { itest!(compile_errors { args: "compile -A --quiet npm/cached_only/main.ts", - output_str: Some("error: npm specifiers have not yet been implemented for this sub command (https://github.com/denoland/deno/issues/15960). Found: npm:chalk@5\n"), + output_str: Some("error: npm specifiers have not yet been implemented for this sub command (https://github.com/denoland/deno/issues/15960). Found: npm:chalk@5.0.1\n"), exit_code: 1, envs: env_vars_for_npm_tests(), http_server: true, @@ -828,7 +828,7 @@ itest!(compile_errors { itest!(bundle_errors { args: "bundle --quiet npm/esm/main.js", - output_str: Some("error: npm specifiers have not yet been implemented for this sub command (https://github.com/denoland/deno/issues/15960). Found: npm:chalk@5\n"), + output_str: Some("error: npm specifiers have not yet been implemented for this sub command (https://github.com/denoland/deno/issues/15960). Found: npm:chalk@5.0.1\n"), exit_code: 1, envs: env_vars_for_npm_tests(), http_server: true, diff --git a/cli/tests/testdata/cert/cafile_info.ts.out b/cli/tests/testdata/cert/cafile_info.ts.out index ddece3019..279453f88 100644 --- a/cli/tests/testdata/cert/cafile_info.ts.out +++ b/cli/tests/testdata/cert/cafile_info.ts.out @@ -4,11 +4,11 @@ dependencies: 8 unique size: [WILDCARD] https://localhost:5545/cert/cafile_info.ts ([WILDCARD]) -├── https://localhost:5545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) -├── https://localhost:5545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) -├── https://localhost:5545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) -├── https://localhost:5545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) -├── https://localhost:5545/subdir/mt_text_javascript.j1.js ([WILDCARD]) ├── https://localhost:5545/subdir/mt_text_typescript.t1.ts ([WILDCARD]) +├── https://localhost:5545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) ├── https://localhost:5545/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) -└── https://localhost:5545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) +├── https://localhost:5545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) +├── https://localhost:5545/subdir/mt_text_javascript.j1.js ([WILDCARD]) +├── https://localhost:5545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) +├── https://localhost:5545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) +└── https://localhost:5545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) diff --git a/cli/tests/testdata/info/049_info_flag_script_jsx.out b/cli/tests/testdata/info/049_info_flag_script_jsx.out index 244541696..f49fc2356 100644 --- a/cli/tests/testdata/info/049_info_flag_script_jsx.out +++ b/cli/tests/testdata/info/049_info_flag_script_jsx.out @@ -5,11 +5,11 @@ dependencies: 8 unique size: [WILDCARD] http://127.0.0.1:4545/run/048_media_types_jsx.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx ([WILDCARD]) ├── http://localhost:4545/subdir/mt_text_typescript_tsx.t1.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx ([WILDCARD]) ├── http://localhost:4545/subdir/mt_video_mp2t_tsx.t3.tsx ([WILDCARD]) -└── http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx ([WILDCARD]) +└── http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx ([WILDCARD]) diff --git a/cli/tests/testdata/info/076_info_json_deps_order.out b/cli/tests/testdata/info/076_info_json_deps_order.out index 98b5d5d50..a1b15e00c 100644 --- a/cli/tests/testdata/info/076_info_json_deps_order.out +++ b/cli/tests/testdata/info/076_info_json_deps_order.out @@ -4,6 +4,7 @@ ], "modules": [ { + "kind": "esm", "dependencies": [ { "specifier": "./recursive_imports/A.ts", @@ -22,13 +23,13 @@ } } ], - "kind": "esm", "local": "[WILDCARD]076_info_json_deps_order.ts", [WILDCARD] "mediaType": "TypeScript", "specifier": "file://[WILDCARD]/076_info_json_deps_order.ts" }, { + "kind": "esm", "dependencies": [ { "specifier": "./B.ts", @@ -63,13 +64,13 @@ } } ], - "kind": "esm", "local": "[WILDCARD]A.ts", [WILDCARD] "mediaType": "TypeScript", "specifier": "file://[WILDCARD]/recursive_imports/A.ts" }, { + "kind": "esm", "dependencies": [ { "specifier": "./C.ts", @@ -104,13 +105,13 @@ } } ], - "kind": "esm", "local": "[WILDCARD]B.ts", [WILDCARD] "mediaType": "TypeScript", "specifier": "file://[WILDCARD]/recursive_imports/B.ts" }, { + "kind": "esm", "dependencies": [ { "specifier": "./A.ts", @@ -145,7 +146,6 @@ } } ], - "kind": "esm", "local": "[WILDCARD]C.ts", [WILDCARD] "mediaType": "TypeScript", diff --git a/cli/tests/testdata/info/json_output/main.out b/cli/tests/testdata/info/json_output/main.out index aaef028c0..5a89d5cab 100644 --- a/cli/tests/testdata/info/json_output/main.out +++ b/cli/tests/testdata/info/json_output/main.out @@ -4,6 +4,7 @@ ], "modules": [ { + "kind": "esm", "dependencies": [ { "specifier": "../../subdir/mod1.ts", @@ -22,13 +23,13 @@ } } ], - "kind": "esm", "local": "[WILDCARD]main.ts", [WILDCARD] "mediaType": "TypeScript", "specifier": "file://[WILDCARD]/json_output/main.ts" }, { + "kind": "esm", "dependencies": [ { "specifier": "./subdir2/mod2.ts", @@ -47,7 +48,6 @@ } } ], - "kind": "esm", "local": "[WILDCARD]mod1.ts", [WILDCARD] "mediaType": "TypeScript", @@ -61,6 +61,7 @@ "specifier": "file://[WILDCARD]/subdir/print_hello.ts" }, { + "kind": "esm", "dependencies": [ { "specifier": "../print_hello.ts", @@ -79,7 +80,6 @@ } } ], - "kind": "esm", "local": "[WILDCARD]mod2.ts", [WILDCARD] "mediaType": "TypeScript", diff --git a/cli/tests/testdata/info/multiple_imports.out b/cli/tests/testdata/info/multiple_imports.out index ea35e69c8..cb13318ca 100644 --- a/cli/tests/testdata/info/multiple_imports.out +++ b/cli/tests/testdata/info/multiple_imports.out @@ -5,11 +5,11 @@ dependencies: 8 unique size: [WILDCARD] http://127.0.0.1:4545/run/019_media_types.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_javascript.j1.js ([WILDCARD]) ├── http://localhost:4545/subdir/mt_text_typescript.t1.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) ├── http://localhost:4545/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) -└── http://localhost:4545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_javascript.j1.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) +└── http://localhost:4545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) diff --git a/cli/tests/testdata/npm/cached_only/main.out b/cli/tests/testdata/npm/cached_only/main.out index f49494839..d03420fee 100644 --- a/cli/tests/testdata/npm/cached_only/main.out +++ b/cli/tests/testdata/npm/cached_only/main.out @@ -1,4 +1,2 @@ -error: Error getting response at http://localhost:4545/npm/registry/chalk for package "chalk" - -Caused by: - An npm specifier not found in cache: "chalk", --cached-only is specified. +error: Error getting response at http://localhost:4545/npm/registry/chalk for package "chalk": An npm specifier not found in cache: "chalk", --cached-only is specified. + at file:///[WILDCARD]/testdata/npm/cached_only/main.ts:1:19 diff --git a/cli/tests/testdata/npm/cjs_with_deps/main.out b/cli/tests/testdata/npm/cjs_with_deps/main.out index 23c217f7a..3a16ff467 100644 --- a/cli/tests/testdata/npm/cjs_with_deps/main.out +++ b/cli/tests/testdata/npm/cjs_with_deps/main.out @@ -1,5 +1,7 @@ -Download http://localhost:4545/npm/registry/chai Download http://localhost:4545/npm/registry/chalk +Download http://localhost:4545/npm/registry/chai +Download http://localhost:4545/npm/registry/ansi-styles +Download http://localhost:4545/npm/registry/supports-color Download http://localhost:4545/npm/registry/assertion-error Download http://localhost:4545/npm/registry/check-error Download http://localhost:4545/npm/registry/deep-eql @@ -7,8 +9,6 @@ Download http://localhost:4545/npm/registry/get-func-name Download http://localhost:4545/npm/registry/loupe Download http://localhost:4545/npm/registry/pathval Download http://localhost:4545/npm/registry/type-detect -Download http://localhost:4545/npm/registry/ansi-styles -Download http://localhost:4545/npm/registry/supports-color Download http://localhost:4545/npm/registry/color-convert Download http://localhost:4545/npm/registry/has-flag Download http://localhost:4545/npm/registry/color-name diff --git a/cli/tests/testdata/npm/cjs_with_deps/main_info.out b/cli/tests/testdata/npm/cjs_with_deps/main_info.out index 345583a90..cf84197e1 100644 --- a/cli/tests/testdata/npm/cjs_with_deps/main_info.out +++ b/cli/tests/testdata/npm/cjs_with_deps/main_info.out @@ -4,19 +4,19 @@ dependencies: 14 unique size: [WILDCARD] file:///[WILDCARD]/npm/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:chai@4.3 - 4.3.6 ([WILDCARD]) -│ ├── npm:assertion-error@1.1.0 ([WILDCARD]) -│ ├── npm:check-error@1.0.2 ([WILDCARD]) -│ ├─┬ npm:deep-eql@3.0.1 ([WILDCARD]) -│ │ └── npm:type-detect@4.0.8 ([WILDCARD]) -│ ├── npm:get-func-name@2.0.0 ([WILDCARD]) -│ ├─┬ npm:loupe@2.3.4 ([WILDCARD]) -│ │ └── npm:get-func-name@2.0.0 ([WILDCARD]) -│ ├── npm:pathval@1.1.1 ([WILDCARD]) -│ └── npm:type-detect@4.0.8 ([WILDCARD]) -└─┬ npm:chalk@4 - 4.1.2 ([WILDCARD]) - ├─┬ npm:ansi-styles@4.3.0 ([WILDCARD]) - │ └─┬ npm:color-convert@2.0.1 ([WILDCARD]) - │ └── npm:color-name@1.1.4 ([WILDCARD]) - └─┬ npm:supports-color@7.2.0 ([WILDCARD]) - └── npm:has-flag@4.0.0 ([WILDCARD]) +├─┬ npm:chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:supports-color@7.2.0 ([WILDCARD]) +│ └── npm:has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:chai@4.3.6 ([WILDCARD]) + ├── npm:assertion-error@1.1.0 ([WILDCARD]) + ├── npm:check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:type-detect@4.0.8 ([WILDCARD]) + ├── npm:get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:loupe@2.3.4 ([WILDCARD]) + │ └── npm:get-func-name@2.0.0 ([WILDCARD]) + ├── npm:pathval@1.1.1 ([WILDCARD]) + └── npm:type-detect@4.0.8 ([WILDCARD]) diff --git a/cli/tests/testdata/npm/cjs_with_deps/main_info_json.out b/cli/tests/testdata/npm/cjs_with_deps/main_info_json.out index bc7b9e162..e2a659a42 100644 --- a/cli/tests/testdata/npm/cjs_with_deps/main_info_json.out +++ b/cli/tests/testdata/npm/cjs_with_deps/main_info_json.out @@ -4,43 +4,43 @@ ], "modules": [ { + "kind": "esm", "dependencies": [ { - "specifier": "npm:chai@4.3", + "specifier": "npm:chalk@4", "code": { - "specifier": "npm:chai@4.3", + "specifier": "npm:chalk@4", "span": { "start": { - "line": 1, - "character": 23 + "line": 0, + "character": 18 }, "end": { - "line": 1, - "character": 37 + "line": 0, + "character": 31 } } }, - "npmPackage": "chai@4.3.6" + "npmPackage": "chalk@4.1.2" }, { - "specifier": "npm:chalk@4", + "specifier": "npm:chai@4.3", "code": { - "specifier": "npm:chalk@4", + "specifier": "npm:chai@4.3", "span": { "start": { - "line": 0, - "character": 18 + "line": 1, + "character": 23 }, "end": { - "line": 0, - "character": 31 + "line": 1, + "character": 37 } } }, - "npmPackage": "chalk@4.1.2" + "npmPackage": "chai@4.3.6" } ], - "kind": "esm", "local": "[WILDCARD]main.js", "emit": null, "map": null, @@ -49,7 +49,10 @@ "specifier": "[WILDCARD]/main.js" } ], - "redirects": {}, + "redirects": { + "npm:chai@4.3": "npm:chai@4.3.6", + "npm:chalk@4": "npm:chalk@4.1.2" + }, "npmPackages": { "ansi-styles@4.3.0": { "name": "ansi-styles", diff --git a/cli/tests/testdata/npm/compare_globals/main.out b/cli/tests/testdata/npm/compare_globals/main.out index e60a39ba6..286834168 100644 --- a/cli/tests/testdata/npm/compare_globals/main.out +++ b/cli/tests/testdata/npm/compare_globals/main.out @@ -1,5 +1,5 @@ -Download http://localhost:4545/npm/registry/@denotest/globals Download http://localhost:4545/npm/registry/@types/node +Download http://localhost:4545/npm/registry/@denotest/globals Download http://localhost:4545/npm/registry/@denotest/globals/1.0.0.tgz Download http://localhost:4545/npm/registry/@types/node/node-18.8.2.tgz Check file:///[WILDCARD]/npm/compare_globals/main.ts diff --git a/cli/tests/testdata/npm/import_map/main.out b/cli/tests/testdata/npm/import_map/main.out index b5b67651e..29f0f4283 100644 --- a/cli/tests/testdata/npm/import_map/main.out +++ b/cli/tests/testdata/npm/import_map/main.out @@ -1,5 +1,5 @@ -Download http://localhost:4545/npm/registry/@denotest/dual-cjs-esm Download http://localhost:4545/npm/registry/chalk +Download http://localhost:4545/npm/registry/@denotest/dual-cjs-esm Download http://localhost:4545/npm/registry/@denotest/dual-cjs-esm/1.0.0.tgz Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz chalk import map loads diff --git a/cli/tests/testdata/npm/info/chalk.out b/cli/tests/testdata/npm/info/chalk.out index 89ea05e71..d7ac95120 100644 --- a/cli/tests/testdata/npm/info/chalk.out +++ b/cli/tests/testdata/npm/info/chalk.out @@ -1,8 +1,7 @@ -type: Unknown dependencies: 5 unique size: [WILDCARD] -npm:chalk@4 - 4.1.2 ([WILDCARD]) +npm:chalk@4.1.2 ([WILDCARD]) ├─┬ npm:ansi-styles@4.3.0 ([WILDCARD]) │ └─┬ npm:color-convert@2.0.1 ([WILDCARD]) │ └── npm:color-name@1.1.4 ([WILDCARD]) diff --git a/cli/tests/testdata/npm/info/chalk_json.out b/cli/tests/testdata/npm/info/chalk_json.out index f6673d032..0f86bc994 100644 --- a/cli/tests/testdata/npm/info/chalk_json.out +++ b/cli/tests/testdata/npm/info/chalk_json.out @@ -5,11 +5,13 @@ "modules": [ { "kind": "npm", - "specifier": "npm:chalk@4", + "specifier": "npm:chalk@4.1.2", "npmPackage": "chalk@4.1.2" } ], - "redirects": {}, + "redirects": { + "npm:chalk@4": "npm:chalk@4.1.2" + }, "npmPackages": { "ansi-styles@4.3.0": { "name": "ansi-styles", diff --git a/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info.out b/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info.out index c9c4a59c1..d85b00094 100644 --- a/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info.out +++ b/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info.out @@ -4,11 +4,11 @@ dependencies: 6 unique size: [WILDCARD] file:///[WILDCARD]/testdata/npm/peer_deps_with_copied_folders/main.ts (171B) -├─┬ npm:@denotest/peer-dep-test-child@1 - 1.0.0 ([WILDCARD]) +├─┬ npm:@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) │ ├─┬ npm:@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) │ │ └── npm:@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) │ └── npm:@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -└─┬ npm:@denotest/peer-dep-test-child@2 - 2.0.0 ([WILDCARD]) +└─┬ npm:@denotest/peer-dep-test-child@2.0.0 ([WILDCARD]) ├─┬ npm:@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0 ([WILDCARD]) │ └── npm:@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) └── npm:@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) diff --git a/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out b/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out index 634ec6251..6a455b001 100644 --- a/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out +++ b/cli/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out @@ -4,6 +4,7 @@ ], "modules": [ { + "kind": "esm", "dependencies": [ { "specifier": "npm:@denotest/peer-dep-test-child@1", @@ -40,7 +41,6 @@ "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" } ], - "kind": "esm", "local": "[WILDCARD]main.ts", "emit": null, "map": null, @@ -49,7 +49,10 @@ "specifier": "file://[WILDCARD]/main.ts" } ], - "redirects": {}, + "redirects": { + "npm:@denotest/peer-dep-test-child@1": "npm:@denotest/peer-dep-test-child@1.0.0", + "npm:@denotest/peer-dep-test-child@2": "npm:@denotest/peer-dep-test-child@2.0.0" + }, "npmPackages": { "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { "name": "@denotest/peer-dep-test-child", diff --git a/cli/tests/testdata/npm/typescript_file_in_package/main.out b/cli/tests/testdata/npm/typescript_file_in_package/main.out index ba53f7725..0d6f53cd9 100644 --- a/cli/tests/testdata/npm/typescript_file_in_package/main.out +++ b/cli/tests/testdata/npm/typescript_file_in_package/main.out @@ -1,6 +1,6 @@ Download http://localhost:4545/npm/registry/@denotest/typescript-file Download http://localhost:4545/npm/registry/@denotest/typescript-file/1.0.0.tgz -error: Could not resolve 'npm:@denotest/typescript-file'. +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 |