From 68b388a93a3efe443fc5e306e883847bfb8551db Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 14 Oct 2024 14:00:02 +0530 Subject: fix(ext/node): allow writing to tty columns (#26201) Behave similar to Node.js where modifying `stdout.columns` doesn't really resize the terminal. Ref https://github.com/nodejs/node/issues/17529 Fixes https://github.com/denoland/deno/issues/26196 --- tests/unit_node/process_test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/unit_node/process_test.ts') diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 0e0f169d6..9506fb609 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -1175,3 +1175,8 @@ Deno.test("process.cpuUsage()", () => { assert(typeof cpuUsage.user === "number"); assert(typeof cpuUsage.system === "number"); }); + +Deno.test("process.stdout.columns writable", () => { + process.stdout.columns = 80; + assertEquals(process.stdout.columns, 80); +}); -- cgit v1.2.3 From 167f674c7cbb9632000c1feb0b747ba098b01c12 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:58:11 -0700 Subject: fix: don't warn on ignored signals on windows (#26332) Closes #26183. The warnings are super noisy and not actionable for the user --- tests/unit_node/process_test.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'tests/unit_node/process_test.ts') diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 9506fb609..f9138c8f0 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -25,7 +25,6 @@ import { assertThrows, fail, } from "@std/assert"; -import { assertSpyCall, assertSpyCalls, spy } from "@std/testing/mock"; import { stripAnsiCode } from "@std/fmt/colors"; import * as path from "@std/path"; import { delay } from "@std/async/delay"; @@ -239,33 +238,6 @@ Deno.test({ }, }); -Deno.test({ - name: "process.on - ignored signals on windows", - ignore: Deno.build.os !== "windows", - fn() { - const ignoredSignals = ["SIGHUP", "SIGUSR1", "SIGUSR2"]; - - for (const signal of ignoredSignals) { - using consoleSpy = spy(console, "warn"); - const handler = () => {}; - process.on(signal, handler); - process.off(signal, handler); - assertSpyCall(consoleSpy, 0, { - args: [`Ignoring signal "${signal}" on Windows`], - }); - } - - { - using consoleSpy = spy(console, "warn"); - const handler = () => {}; - process.on("SIGTERM", handler); - process.off("SIGTERM", handler); - // No warning is made for SIGTERM - assertSpyCalls(consoleSpy, 0); - } - }, -}); - Deno.test( { permissions: { run: true, read: true } }, async function processKill() { -- cgit v1.2.3 From 43812ee8ff0eb2584c7beb18639da14d96d06817 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 13 Nov 2024 08:02:09 +0530 Subject: fix(ext/node): process.getBuiltinModule (#26833) Closes https://github.com/denoland/deno/issues/26832 --- tests/unit_node/process_test.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/unit_node/process_test.ts') diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index f9138c8f0..49de2dce1 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -1152,3 +1152,9 @@ Deno.test("process.stdout.columns writable", () => { process.stdout.columns = 80; assertEquals(process.stdout.columns, 80); }); + +Deno.test("getBuiltinModule", () => { + assert(process.getBuiltinModule("fs")); + assert(process.getBuiltinModule("node:fs")); + assertEquals(process.getBuiltinModule("something"), undefined); +}); -- cgit v1.2.3