diff --git a/ext/node/lib.rs b/ext/node/lib.rs index 73b4497fc7..a820c4476f 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -483,7 +483,6 @@ deno_core::extension!(deno_node, "_zlib_binding.mjs", "_zlib.mjs", "assertion_error.ts", - "inspector.ts", "internal_binding/_libuv_winerror.ts", "internal_binding/_listen.ts", "internal_binding/_node.ts", @@ -616,6 +615,7 @@ deno_core::extension!(deno_node, "node:http" = "http.ts", "node:http2" = "http2.ts", "node:https" = "https.ts", + "node:inspector" = "inspector.ts", "node:module" = "01_require.js", "node:net" = "net.ts", "node:os" = "os.ts", diff --git a/ext/node/polyfill.rs b/ext/node/polyfill.rs index b4030a4913..175228a258 100644 --- a/ext/node/polyfill.rs +++ b/ext/node/polyfill.rs @@ -45,6 +45,7 @@ generate_builtin_node_module_lists! { "http", "http2", "https", + "inspector", "module", "net", "os", diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 1636edcb41..40bb7f2963 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -92,7 +92,7 @@ import fsPromises from "node:fs/promises"; import http from "node:http"; import http2 from "node:http2"; import https from "node:https"; -import inspector from "ext:deno_node/inspector.ts"; +import inspector from "node:inspector"; import internalCp from "ext:deno_node/internal/child_process.ts"; import internalCryptoCertificate from "ext:deno_node/internal/crypto/certificate.ts"; import internalCryptoCipher from "ext:deno_node/internal/crypto/cipher.ts"; diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 28c36cd205..e1ee250582 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -7548,6 +7548,7 @@ fn lsp_completions_node_specifier() { "node:http", "node:http2", "node:https", + "node:inspector", "node:module", "node:net", "node:os", diff --git a/tests/integration/node_unit_tests.rs b/tests/integration/node_unit_tests.rs index e87f1cd2f8..74ed293e3c 100644 --- a/tests/integration/node_unit_tests.rs +++ b/tests/integration/node_unit_tests.rs @@ -74,6 +74,7 @@ util::unit_test_factory!( fetch_test, http_test, http2_test, + inspector_test, _randomBytes_test = internal / _randomBytes_test, _randomFill_test = internal / _randomFill_test, _randomInt_test = internal / _randomInt_test, diff --git a/tests/unit_node/inspector_test.ts b/tests/unit_node/inspector_test.ts new file mode 100644 index 0000000000..ec4d0ae3a0 --- /dev/null +++ b/tests/unit_node/inspector_test.ts @@ -0,0 +1,7 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +import inspector from "node:inspector"; +import { assertEquals } from "@std/assert/equals"; + +Deno.test("[node/inspector] - importing inspector works", () => { + assertEquals(typeof inspector.open, "function"); +}); diff --git a/tools/core_import_map.json b/tools/core_import_map.json index 726163e08e..e7703a40c0 100644 --- a/tools/core_import_map.json +++ b/tools/core_import_map.json @@ -78,6 +78,7 @@ "node:http": "../ext/node/polyfills/http.ts", "node:http2": "../ext/node/polyfills/http2.ts", "node:https": "../ext/node/polyfills/https.ts", + "node:inspector": "../ext/node/polyfills/inspector.ts", "ext:deno_node/inspector.ts": "../ext/node/polyfills/inspector.ts", "ext:deno_node/internal_binding/_libuv_winerror.ts": "../ext/node/polyfills/internal_binding/_libuv_winerror.ts", "ext:deno_node/internal_binding/_listen.ts": "../ext/node/polyfills/internal_binding/_listen.ts",