mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 06:49:53 +00:00

The tap skipping output is so prevalent yet obscure in nature that we ought to move it into it's own function in test/common.js PR-URL: https://github.com/nodejs/node/pull/6697 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
29 lines
583 B
JavaScript
29 lines
583 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var TTY = process.binding('tty_wrap').TTY;
|
|
var isTTY = process.binding('tty_wrap').isTTY;
|
|
|
|
if (isTTY(1) == false) {
|
|
common.skip('fd 1 is not a tty.');
|
|
return;
|
|
}
|
|
|
|
var handle = new TTY(1);
|
|
var callbacks = 0;
|
|
|
|
var req1 = handle.writeBuffer(Buffer.from('hello world\n'));
|
|
req1.oncomplete = function() {
|
|
callbacks++;
|
|
};
|
|
|
|
var req2 = handle.writeBuffer(Buffer.from('hello world\n'));
|
|
req2.oncomplete = function() {
|
|
callbacks++;
|
|
};
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(2, callbacks);
|
|
});
|