From 721e21073a740e9d1fdbf6400debd2328914c38d Mon Sep 17 00:00:00 2001 From: Matteo Depalo Date: Mon, 17 Jul 2023 10:55:37 +0100 Subject: [PATCH] Try to fix CI --- test/fixtures/erase-once-with-static.tsx | 2 ++ test/fixtures/erase-once.tsx | 2 ++ test/render.tsx | 8 +++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/fixtures/erase-once-with-static.tsx b/test/fixtures/erase-once-with-static.tsx index b8669fa34..9dfac4d72 100644 --- a/test/fixtures/erase-once-with-static.tsx +++ b/test/fixtures/erase-once-with-static.tsx @@ -1,3 +1,4 @@ +import process from 'node:process'; import React, {useState} from 'react'; import {Box, Static, Text, render, useInput} from '../../src/index.js'; @@ -28,4 +29,5 @@ function Test() { ); } +process.stdout.rows = Number(process.argv[2]); render(); diff --git a/test/fixtures/erase-once.tsx b/test/fixtures/erase-once.tsx index ee37d3d55..267702c0e 100644 --- a/test/fixtures/erase-once.tsx +++ b/test/fixtures/erase-once.tsx @@ -1,3 +1,4 @@ +import process from 'node:process'; import React, {useState} from 'react'; import {Box, Text, render, useInput} from '../../src/index.js'; @@ -22,4 +23,5 @@ function Test() { ); } +process.stdout.rows = Number(process.argv[2]); render(); diff --git a/test/render.tsx b/test/render.tsx index 45e5764c4..d731737d4 100644 --- a/test/render.tsx +++ b/test/render.tsx @@ -114,10 +114,9 @@ test.serial('erase screen', async t => { }); test.serial('erase screen once then continue rendering as usual', async t => { - const ps = term('erase-once', [], {rows: 3}); - await delay(1000); + const ps = term('erase-once', ['3']); + await ps.waitForExit(); - t.true(ps.output.includes(ansiEscapes.clearTerminal)); t.true(ps.output.includes('A')); t.true(ps.output.includes('B')); t.true(ps.output.includes('C')); @@ -137,10 +136,9 @@ test.serial('erase screen once then continue rendering as usual', async t => { test.serial( 'erase screen once then continue rendering as usual with present', async t => { - const ps = term('erase-once-with-static', [], {rows: 3}); + const ps = term('erase-once-with-static', ['3']); await delay(1000); - t.true(ps.output.includes(ansiEscapes.clearTerminal)); t.true(ps.output.includes('X')); t.true(ps.output.includes('Y')); t.true(ps.output.includes('Z'));