diff options
Diffstat (limited to 'cli/tests')
13 files changed, 55 insertions, 49 deletions
diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 022148ce4..f43b1cff9 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -120,9 +120,9 @@ fn standalone_error() { assert_contains!(stderr, "error: Uncaught Error: boom!"); assert_contains!(stderr, "throw new Error(\"boom!\");"); assert_contains!(stderr, "\n at boom (file://"); - assert_contains!(stderr, "standalone_error.ts:2:11"); + assert_contains!(stderr, "standalone_error.ts:2:9"); assert_contains!(stderr, "at foo (file://"); - assert_contains!(stderr, "standalone_error.ts:5:5"); + assert_contains!(stderr, "standalone_error.ts:5:3"); assert_contains!(stderr, "standalone_error.ts:7:1"); } diff --git a/cli/tests/integration/inspector_tests.rs b/cli/tests/integration/inspector_tests.rs index 79422ee5a..c507204e4 100644 --- a/cli/tests/integration/inspector_tests.rs +++ b/cli/tests/integration/inspector_tests.rs @@ -75,6 +75,12 @@ struct InspectorTester { stdout_lines: Box<dyn Iterator<Item = String>>, } +impl Drop for InspectorTester { + fn drop(&mut self) { + _ = self.child.kill(); + } +} + fn ignore_script_parsed(msg: &str) -> bool { !msg.starts_with(r#"{"method":"Debugger.scriptParsed","#) } @@ -953,7 +959,7 @@ async fn inspector_with_ts_files() { tester.assert_received_messages( &[ r#"{"id":4,"result":{"scriptSource":"import { foo } from \"./foo.ts\";\nimport { bar } from \"./bar.js\";\nconsole.log(foo());\nconsole.log(bar());\n//# sourceMappingURL=data:application/json;base64,"#, - r#"{"id":5,"result":{"scriptSource":"class Foo {\n hello() {\n return \"hello\";\n }\n}\nexport function foo() {\n const f = new Foo();\n return f.hello();\n}\n//# sourceMappingURL=data:application/json;base64,"#, + r#"{"id":5,"result":{"scriptSource":"class Foo {\n hello() {\n return \"hello\";\n }\n}\nexport function foo() {\n const f = new Foo();\n return f.hello();\n}\n//# sourceMappingURL=data:application/json;base64,"#, r#"{"id":6,"result":{"scriptSource":"export function bar() {\n return \"world\";\n}\n"#, ], &[], diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index f27befe54..1352777d2 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -988,12 +988,12 @@ fn ensure_registry_files_local() { } itest!(bundle_errors { - args: "bundle --quiet npm/esm/main.js", - output_str: Some("error: npm specifiers have not yet been implemented for this subcommand (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, - }); + args: "bundle --quiet npm/esm/main.js", + output_str: Some("error: npm specifiers have not yet been implemented for this subcommand (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, +}); itest!(info_chalk_display { args: "info --quiet npm/cjs_with_deps/main.js", 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 cf84197e1..bcaaf1eec 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: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]) +├─┬ 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 e2a659a42..fd850b8a1 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 @@ -50,8 +50,8 @@ } ], "redirects": { - "npm:chai@4.3": "npm:chai@4.3.6", - "npm:chalk@4": "npm:chalk@4.1.2" + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" }, "npmPackages": { "ansi-styles@4.3.0": { diff --git a/cli/tests/testdata/npm/info/chalk.out b/cli/tests/testdata/npm/info/chalk.out index d7ac95120..63fa20da5 100644 --- a/cli/tests/testdata/npm/info/chalk.out +++ b/cli/tests/testdata/npm/info/chalk.out @@ -1,9 +1,9 @@ dependencies: 5 unique size: [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:/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]) diff --git a/cli/tests/testdata/npm/info/chalk_json.out b/cli/tests/testdata/npm/info/chalk_json.out index 0f86bc994..bffed4ad4 100644 --- a/cli/tests/testdata/npm/info/chalk_json.out +++ b/cli/tests/testdata/npm/info/chalk_json.out @@ -5,12 +5,12 @@ "modules": [ { "kind": "npm", - "specifier": "npm:chalk@4.1.2", + "specifier": "npm:/chalk@4.1.2", "npmPackage": "chalk@4.1.2" } ], "redirects": { - "npm:chalk@4": "npm:chalk@4.1.2" + "npm:chalk@4": "npm:/chalk@4.1.2" }, "npmPackages": { "ansi-styles@4.3.0": { diff --git a/cli/tests/testdata/npm/invalid_package_name/main.out b/cli/tests/testdata/npm/invalid_package_name/main.out index 7d2b3754d..b4a421bd7 100644 --- a/cli/tests/testdata/npm/invalid_package_name/main.out +++ b/cli/tests/testdata/npm/invalid_package_name/main.out @@ -1,2 +1,2 @@ -error: Not a valid package: @foo +error: Invalid package specifier 'npm:@foo'. Did not contain a valid package name. at [WILDCARD]/invalid_package_name/main.js:1:22 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 d85b00094..638f9328d 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.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.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]) +├─┬ 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.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 6a455b001..a4306a6d5 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 @@ -50,8 +50,8 @@ } ], "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" + "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": { diff --git a/cli/tests/testdata/package_json/basic/main.info.out b/cli/tests/testdata/package_json/basic/main.info.out index 3572c75e1..b283a0ee0 100644 --- a/cli/tests/testdata/package_json/basic/main.info.out +++ b/cli/tests/testdata/package_json/basic/main.info.out @@ -5,4 +5,4 @@ size: [WILDCARD] file:///[WILDCARD]/main.ts (63B) └─┬ file:///[WILDCARD]/lib.ts (166B) - └── npm:@denotest/esm-basic@1.0.0 (416B) + └── npm:/@denotest/esm-basic@1.0.0 (416B) diff --git a/cli/tests/testdata/package_json/invalid_value/error.ts.out b/cli/tests/testdata/package_json/invalid_value/error.ts.out index 866388e60..faa811a30 100644 --- a/cli/tests/testdata/package_json/invalid_value/error.ts.out +++ b/cli/tests/testdata/package_json/invalid_value/error.ts.out @@ -1,6 +1,6 @@ error: Parsing version constraints in the application-level package.json is more strict at the moment. -Invalid npm specifier version requirement. Unexpected character. +Invalid specifier version requirement. Unexpected character. invalid stuff that won't parse ~ at file:///[WILDCARD]/error.ts:2:23 diff --git a/cli/tests/testdata/package_json/invalid_value/task.out b/cli/tests/testdata/package_json/invalid_value/task.out index 823c50612..c78a32739 100644 --- a/cli/tests/testdata/package_json/invalid_value/task.out +++ b/cli/tests/testdata/package_json/invalid_value/task.out @@ -1,4 +1,4 @@ -Warning Ignoring dependency '@denotest/cjs-default-export' in package.json because its version requirement failed to parse: Invalid npm specifier version requirement. Unexpected character. +Warning Ignoring dependency '@denotest/cjs-default-export' in package.json because its version requirement failed to parse: Invalid specifier version requirement. Unexpected character. invalid stuff that won't parse ~ Warning Currently only basic package.json `scripts` are supported. Programs like `rimraf` or `cross-env` will not work correctly. This will be fixed in an upcoming release. |