Created
February 12, 2022 21:59
-
-
Save chico/099a10462b605e713c6da6345d229458 to your computer and use it in GitHub Desktop.
3 - Testing with sinon & mock-stdin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mockStdin from 'mock-stdin' | |
const stubStdin = (input, delay) => { | |
let stdin = mockStdin.stdin() | |
setTimeout(() => stdin.send(input), delay) | |
} | |
... | |
stubStdin('\n', 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment