From 819ca8442911469ce0cb10c0845239d56281434b Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Tue, 11 Jan 2022 09:43:48 +0000 Subject: [PATCH] Fix bug with process.stdout.clearLine being missing. Use readline instead. --- lib/eltro.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/eltro.mjs b/lib/eltro.mjs index f4f39ba..a6831da 100644 --- a/lib/eltro.mjs +++ b/lib/eltro.mjs @@ -1,3 +1,4 @@ +import * as readline from 'readline' import { printError } from './cli.mjs' function Group(e, name) { @@ -235,8 +236,8 @@ Eltro.prototype.__runTest = async function(stats, test, prefix = 'Test', child = } if (this.reporter === 'list') { - process.stdout.clearLine(); - process.stdout.cursorTo(0); + readline.clearLine(process.stdout, 0) + readline.cursorTo(process.stdout, 0, null) if (markRealTest.skipTest) { process.stdout.write(' \x1b[94m- ' + markRealTest.name + '\x1b[0m\n') } else if (!markRealTest.error) {