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 Aug 1, 2023
1 parent 9fb2840 commit 80c847f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions test/fixtures/erase-once-with-static.tsx
@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import {Box, Static, Text, render, useInput} from '../../src/index.js';

function Test() {
function EraseOnceWithStatic() {
const [fullHeight, setFullHeight] = useState(true);

useInput(
Expand All @@ -28,4 +28,4 @@ function Test() {
);
}

render(<Test />);
render(<EraseOnceWithStatic />);
4 changes: 2 additions & 2 deletions test/fixtures/erase-once.tsx
@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import {Box, Text, render, useInput} from '../../src/index.js';

function Test() {
function EraseOnce() {
const [fullHeight, setFullHeight] = useState(true);

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

render(<Test />);
render(<EraseOnce />);
2 changes: 0 additions & 2 deletions test/fixtures/erase-with-static.tsx
@@ -1,4 +1,3 @@
import process from 'node:process';
import React from 'react';
import {Static, Box, Text, render} from '../../src/index.js';

Expand All @@ -18,5 +17,4 @@ function EraseWithStatic() {
);
}

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

Expand All @@ -12,5 +11,4 @@ function Erase() {
);
}

process.stdout.rows = Number(process.argv[2]);
render(<Erase />);
10 changes: 4 additions & 6 deletions test/render.tsx
Expand Up @@ -80,7 +80,7 @@ const term = (
};

test.serial('do not erase screen', async t => {
const ps = term('erase', ['4']);
const ps = term('erase', [], {rows: 4});
await ps.waitForExit();
t.false(ps.output.includes(ansiEscapes.clearTerminal));

Expand All @@ -92,7 +92,7 @@ test.serial('do not erase screen', async t => {
test.serial(
'do not erase screen where <Static> is taller than viewport',
async t => {
const ps = term('erase-with-static', ['4']);
const ps = term('erase-with-static', [], {rows: 4});

await ps.waitForExit();
t.false(ps.output.includes(ansiEscapes.clearTerminal));
Expand All @@ -104,7 +104,7 @@ test.serial(
);

test.serial('erase screen', async t => {
const ps = term('erase', ['3']);
const ps = term('erase', [], {rows: 3});
await ps.waitForExit();
t.true(ps.output.includes(ansiEscapes.clearTerminal));

Expand All @@ -117,7 +117,6 @@ test.serial('erase screen once then continue rendering as usual', async t => {
const ps = term('erase-once', [], {rows: 3});
await delay(1000);

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 @@ -140,7 +139,6 @@ test.serial(
const ps = term('erase-once-with-static', [], {rows: 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 All @@ -164,7 +162,7 @@ test.serial(
test.serial(
'erase screen where <Static> exists but interactive part is taller than viewport',
async t => {
const ps = term('erase', ['3']);
const ps = term('erase', [], {rows: 3});
await ps.waitForExit();
t.true(ps.output.includes(ansiEscapes.clearTerminal));

Expand Down

0 comments on commit 80c847f

Please sign in to comment.