From a11681a9b02f2f4a0f2bf6945a44b2937c6a9af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 26 May 2023 16:18:27 +0200 Subject: refactor(node): use internal io and fs APIs (#19267) --- ext/node/polyfills/assertion_error.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/node/polyfills/assertion_error.ts') diff --git a/ext/node/polyfills/assertion_error.ts b/ext/node/polyfills/assertion_error.ts index bc3ebb2a3..0c54f12cd 100644 --- a/ext/node/polyfills/assertion_error.ts +++ b/ext/node/polyfills/assertion_error.ts @@ -23,6 +23,7 @@ import { inspect } from "ext:deno_node/util.ts"; import { stripColor as removeColors } from "ext:deno_node/_util/std_fmt_colors.ts"; +import * as io from "ext:deno_io/12_io.js"; function getConsoleWidth(): number { try { @@ -159,7 +160,7 @@ export function createErrDiff( // If the stderr is a tty and the input length is lower than the current // columns per line, add a mismatch indicator below the output. If it is // not a tty, use a default value of 80 characters. - const maxLength = Deno.isatty(Deno.stderr.rid) ? getConsoleWidth() : 80; + const maxLength = Deno.isatty(io.stderr.rid) ? getConsoleWidth() : 80; if (inputLength < maxLength) { while (actualRaw[i] === expectedRaw[i]) { i++; @@ -402,7 +403,7 @@ export class AssertionError extends Error { if (message != null) { super(String(message)); } else { - if (Deno.isatty(Deno.stderr.rid)) { + if (Deno.isatty(io.stderr.rid)) { // Reset on each call to make sure we handle dynamically set environment // variables correct. if (Deno.noColor) { -- cgit v1.2.3