test(cli): use dummy stdout for Ink to prevent double writes and fix CI timeouts

This commit is contained in:
mkorwel
2026-04-16 17:36:44 +00:00
parent f4d5b42fd4
commit 7a63c680dd
2 changed files with 8 additions and 13 deletions
+1 -9
View File
@@ -4,21 +4,13 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { describe, it, expect, vi } from 'vitest';
import { useState, useEffect, act } from 'react';
import { Text } from 'ink';
import { renderHook, render } from './render.js';
import { waitFor } from './async.js';
describe.sequential('render', () => {
beforeEach(() => {
vi.useFakeTimers();
});
afterEach(() => {
vi.useRealTimers();
});
it('should render a component', async () => {
const { lastFrame, unmount } = await render(<Text>Hello World</Text>);
expect(lastFrame()).toBe('Hello World\n');