Skip to content

Commit

Permalink
Try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodepalo committed Jul 17, 2023
1 parent 178a873 commit 721e210
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions test/fixtures/erase-once-with-static.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'node:process';
import React, {useState} from 'react';
import {Box, Static, Text, render, useInput} from '../../src/index.js';

Expand Down Expand Up @@ -28,4 +29,5 @@ function Test() {
);
}

process.stdout.rows = Number(process.argv[2]);
render(<Test />);
2 changes: 2 additions & 0 deletions test/fixtures/erase-once.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'node:process';
import React, {useState} from 'react';
import {Box, Text, render, useInput} from '../../src/index.js';

Expand All @@ -22,4 +23,5 @@ function Test() {
);
}

process.stdout.rows = Number(process.argv[2]);
render(<Test />);
8 changes: 3 additions & 5 deletions test/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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 <Static> 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'));
Expand Down

0 comments on commit 721e210

Please sign in to comment.