[PR #292] [MERGED] fix: Use mock Readable as stdin in test renderer #1211

Closed
opened 2026-03-14 09:24:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/292
Author: @veracioux
Created: 11/10/2025
Status: Merged
Merged: 11/19/2025
Merged by: @kommander

Base: mainHead: fix/test-stdin


📝 Commits (4)

  • 433d114 fix: Use mock Readable as stdin in test renderer
  • 69a8489 refactor: Cast test stdin to NodeJS.ReadStream
  • 4330a17 style: Format code
  • 9546a36 Merge remote-tracking branch 'upstream/main' into fix/test-stdin

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 packages/core/src/testing/test-renderer.ts (+2 -1)

📄 Description

Instead of falling back to process.stdin in test renderer, create a mock ReadableStream instead.

All the APIs currently expect a ReadStream, but functionally a ReadableStream might be enough, I propose to try to change all NodeJS.ReadStream types to NodeJS.ReadableStream in the production code if possible.

Alternatively, we can keep the change localized to just the test renderer setup and use an as ReadStream type assertion to satisfy the typechecker.

Fixes #276.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/292 **Author:** [@veracioux](https://github.com/veracioux) **Created:** 11/10/2025 **Status:** ✅ Merged **Merged:** 11/19/2025 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix/test-stdin` --- ### 📝 Commits (4) - [`433d114`](https://github.com/anomalyco/opentui/commit/433d1141c1863709155949115eba93b1e8a6184a) fix: Use mock Readable as stdin in test renderer - [`69a8489`](https://github.com/anomalyco/opentui/commit/69a8489ff0124c6061430c0c68202df0ac1e2fda) refactor: Cast test stdin to NodeJS.ReadStream - [`4330a17`](https://github.com/anomalyco/opentui/commit/4330a17c524281c940d3803d7d1431a503b813d9) style: Format code - [`9546a36`](https://github.com/anomalyco/opentui/commit/9546a3616c0a8a1aaa179f9a91587ed5ef9cb16f) Merge remote-tracking branch 'upstream/main' into fix/test-stdin ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/testing/test-renderer.ts` (+2 -1) </details> ### 📄 Description Instead of falling back to process.stdin in test renderer, create a mock `ReadableStream` instead. All the APIs currently expect a `ReadStream`, but functionally a `ReadableStream` might be enough, I propose to try to change all `NodeJS.ReadStream` types to `NodeJS.ReadableStream` in the production code if possible. Alternatively, we can keep the change localized to just the test renderer setup and use an `as ReadStream` type assertion to satisfy the typechecker. Fixes #276. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:24:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1211
No description provided.