test: make pipe test Windows-compatible
The existing test reads /dev/stdin
instead of using a FIFO pipe created by Node.
- You can't run the existing test on Windows because
/dev/stdin
does not exist on Windows. - Reading
/dev/stdin
withfs.readFile()
seems to be a non-idiomatic approach to readingstdin
with a big dependency on non-universal OS behavior. - The test in this PR is easier to understand and easier to maintain.
(If this is met with general approval, there are two more tests that would get a similar overhaul in subsequent PRs.)