11import React from 'react' ;
2- import { describe , it , expect , vi , beforeEach } from 'vitest' ;
2+ import { describe , it , expect , vi , beforeEach , afterEach } from 'vitest' ;
33import { render } from 'ink' ;
44import { Writable } from 'node:stream' ;
55import { Console } from 'node:console' ;
@@ -13,7 +13,7 @@ if (!console.Console) {
1313
1414const sleep = ( ms : number ) => new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ;
1515
16- const waitForFrameToContain = async ( mockStdout : MockWritable , substring : string , timeout = 2000 ) => {
16+ const waitForFrameToContain = async ( mockStdout : MockWritable , substring : string , timeout = 5000 ) => {
1717 const start = Date . now ( ) ;
1818 while ( Date . now ( ) - start < timeout ) {
1919 const output = mockStdout . frames . join ( '\n' ) ;
@@ -43,10 +43,21 @@ const getDockerSystemStatsSpy = vi.spyOn(containersMod, 'getDockerSystemStats');
4343
4444describe ( 'WatchDashboard' , ( ) => {
4545 let mockStdout : MockWritable ;
46+ let originalCI : string | undefined ;
4647
4748 beforeEach ( ( ) => {
4849 mockStdout = new MockWritable ( ) ;
4950 vi . clearAllMocks ( ) ;
51+ originalCI = process . env . CI ;
52+ delete process . env . CI ;
53+ } ) ;
54+
55+ afterEach ( ( ) => {
56+ if ( originalCI !== undefined ) {
57+ process . env . CI = originalCI ;
58+ } else {
59+ delete process . env . CI ;
60+ }
5061 } ) ;
5162
5263 it ( 'renders loading states and then displays pods and containers' , async ( ) => {
0 commit comments