From d43a4be0d291d2cb1fb4f5a9353b509e87f849eb Mon Sep 17 00:00:00 2001 From: DanSnow Date: Sat, 1 Dec 2018 02:44:05 +0800 Subject: Add Process.output (#1235) --- js/process_test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/process_test.ts') 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(); +}); -- cgit v1.2.3