diff options
author | DanSnow <dododavid006@gmail.com> | 2018-12-01 02:44:05 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-11-30 10:44:05 -0800 |
commit | d43a4be0d291d2cb1fb4f5a9353b509e87f849eb (patch) | |
tree | 13cac9c87e25cf73d266349705785096b90abcaa /js/process_test.ts | |
parent | e749b37b7cc811f32d18e6cc9a8daa5c2f055d00 (diff) |
Add Process.output (#1235)
Diffstat (limited to 'js/process_test.ts')
-rw-r--r-- | js/process_test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/process_test.ts b/js/process_test.ts index 6cba1a1b7..ca2a4a64a 100644 --- a/js/process_test.ts +++ b/js/process_test.ts @@ -176,3 +176,14 @@ testPerm({ run: true }, async function runStderrPiped() { assertEqual(status.signal, undefined); p.close(); }); + +testPerm({ run: true }, async function runOutput() { + const p = run({ + args: ["python", "-c", "import sys; sys.stdout.write('hello')"], + stdout: "piped" + }); + const output = await p.output(); + const s = new TextDecoder().decode(output); + assertEqual(s, "hello"); + p.close(); +}); |