summaryrefslogtreecommitdiff
path: root/test/known_issues/test-stdin-is-always-net.socket.js
blob: 8db33bd7a5ce375689669b8ad43f0fe2e06c4a4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
// Refs: https://github.com/nodejs/node/pull/5916

const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;
const net = require('net');

if (process.argv[2] === 'child') {
  assert(process.stdin instanceof net.Socket);
  return;
}

const proc = spawn(
  process.execPath,
  [__filename, 'child'],
  { stdio: 'ignore' }
);
// To double-check this test, set stdio to 'pipe' and uncomment the line below.
// proc.stderr.pipe(process.stderr);
proc.on('exit', common.mustCall(function(exitCode) {
  assert.strictEqual(exitCode, 0);
}));