summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/assertion_error.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-05-26 16:18:27 +0200
committerGitHub <noreply@github.com>2023-05-26 16:18:27 +0200
commita11681a9b02f2f4a0f2bf6945a44b2937c6a9af1 (patch)
tree55b3a63959b2a935a86c30d8282fbe294f2bb892 /ext/node/polyfills/assertion_error.ts
parentd72e0281ff41a87c32aefd0876bace23470a4dc5 (diff)
refactor(node): use internal io and fs APIs (#19267)
Diffstat (limited to 'ext/node/polyfills/assertion_error.ts')
-rw-r--r--ext/node/polyfills/assertion_error.ts5
1 files changed, 3 insertions, 2 deletions
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) {