Skip to content

From Discord: Exporting MockConsole and MockTerminal for Easier Testing #3776

@effect-bot

Description

@effect-bot

Summary

Elf Pavlik is learning Effect with a friend and has started working on a simple prompt-based CLI. They managed to implement minimal functionality and get a basic test to pass, found on their GitHub repository. They inquired if MockConsole and MockTerminal could be exported for easier testing. Tim Smart mentioned that these could potentially be exported but pointed out that their current testing mostly evaluates the CLI framework rather than the app logic. Maxwell Brown, noted as the CLI guru, agreed and considered the idea while suggesting a review of the API before making it public.

Key takeaways include:

  1. There's an interest in exporting MockConsole and MockTerminal for more straightforward testing.
  2. These modules are primarily used internally for testing the Effect CLI framework.
  3. There is recognition of the CLI's effectiveness, and potential improvements are under consideration for the future.
  4. Elf Pavlik suggested an enhancement in testing select prompts, proposing a method to choose select-prompt options by title rather than by navigating them with repeated key presses.

Maxwell Brown appreciated the suggestions and requested more concrete examples for the desired API change, to which Elf Pavlik responded with a use-case scenario.

Discord thread

https://discord.com/channels/795981131316985866/1294128342651371612

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions