Skip to content

Is it possible to suppose on the current process IO ? #45

Description

@cancerberoSgx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions