Skip to content

Commit

Permalink
fix(node): Add missing inspector/promises (#27491)
Browse files Browse the repository at this point in the history
Add missing `inspector/promises` in node builtin module list, that
causes types checking error.
  • Loading branch information
ije authored and dsherret committed Jan 9, 2025
1 parent 4d95005 commit 1dd49e2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions cli/tsc/00_typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -136063,6 +136063,7 @@ var unprefixedNodeCoreModuleList = [
"https",
"http2",
"inspector",
"inspector/promises",
"module",
"net",
"os",
Expand Down
1 change: 1 addition & 0 deletions ext/node/polyfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ generate_builtin_node_module_lists! {
"http2",
"https",
"inspector",
"inspector/promises",
"module",
"net",
"os",
Expand Down
1 change: 1 addition & 0 deletions tests/integration/lsp_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8712,6 +8712,7 @@ fn lsp_completions_node_specifier() {
"node:http2",
"node:https",
"node:inspector",
"node:inspector/promises",
"node:module",
"node:net",
"node:os",
Expand Down
11 changes: 11 additions & 0 deletions tests/unit_node/inspector_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import inspector, { Session } from "node:inspector";
import inspectorPromises, {
Session as SessionPromise,
} from "node:inspector/promises";
import { assertEquals } from "@std/assert/equals";

Deno.test("[node/inspector] - importing inspector works", () => {
Expand All @@ -9,3 +12,11 @@ Deno.test("[node/inspector] - importing inspector works", () => {
Deno.test("[node/inspector] - Session constructor should not throw", () => {
new Session();
});

Deno.test("[node/inspector/promises] - importing inspector works", () => {
assertEquals(typeof inspectorPromises.open, "function");
});

Deno.test("[node/inspector/promises] - Session constructor should not throw", () => {
new SessionPromise();
});

0 comments on commit 1dd49e2

Please sign in to comment.