diff options
author | Tobias Nießen <tniessen@tnie.de> | 2018-01-02 13:12:41 +0100 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-01-24 01:21:22 -0800 |
commit | 6597b2fd960fac4f28aa8ced71ec95127c651948 (patch) | |
tree | ca48cb2d75652702aaad1f49d316a869892a9d2a /test/parallel/test-child-process-can-write-to-stdout.js | |
parent | 1474a47b80683a2df41c8a7e14eaa26a5a4cdde7 (diff) | |
download | node-new-6597b2fd960fac4f28aa8ced71ec95127c651948.tar.gz |
test: rename regression tests
PR-URL: https://github.com/nodejs/node/pull/17948
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/parallel/test-child-process-can-write-to-stdout.js')
-rw-r--r-- | test/parallel/test-child-process-can-write-to-stdout.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/parallel/test-child-process-can-write-to-stdout.js b/test/parallel/test-child-process-can-write-to-stdout.js new file mode 100644 index 0000000000..bb9ddb71c8 --- /dev/null +++ b/test/parallel/test-child-process-can-write-to-stdout.js @@ -0,0 +1,22 @@ +'use strict'; +// Tests that a spawned child process can write to stdout without throwing. +// See https://github.com/nodejs/node-v0.x-archive/issues/1899. + +require('../common'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const spawn = require('child_process').spawn; + +const child = spawn(process.argv[0], [ + fixtures.path('GH-1899-output.js') +]); +let output = ''; + +child.stdout.on('data', function(data) { + output += data; +}); + +child.on('exit', function(code, signal) { + assert.strictEqual(code, 0); + assert.strictEqual(output, 'hello, world!\n'); +}); |