jprichardson / jprichardson/node-suppose

Is it possible to suppose on the current process IO ?

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
255
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Sorry this is not an issue, just a question. I would like not to spawn new processes but use the same parent process stdin and stdout streams. In my case I would like just to use suppose in integration tests but, instead spawning new processes, call my functions (that perform some interactive cmdline stuff).

I tried with something like the following but without luck:


process.stdout
  .pipe(SupposeStream())
  .when('Hi')
  .respond('Bye')
  .pipe(process.stdin)

// the following stdout would be the function I would like to test. suppose should respond with Bye but is not :(
console.log('Hi')  
setTimeout(() => {
  console.log('Hi')
}, 1000)

Do you know If I'm missing something? Thanks and BTW great project

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the shown SupposeStream pipeline and Node.js process.stdin/process.stdout behavior. Determine whether the existing-process integration-test scenario is supported, and document the supported usage or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.