mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 06:38:13 +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
861 B
JavaScript
29 lines
861 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var fs = require('fs');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
|
if (process.platform === 'sunos' || common.isWindows || common.isAix) {
|
|
common.skip('cannot rmdir current working directory');
|
|
return;
|
|
}
|
|
|
|
var dirname = common.tmpDir + '/cwd-does-not-exist-' + process.pid;
|
|
common.refreshTmpDir();
|
|
fs.mkdirSync(dirname);
|
|
process.chdir(dirname);
|
|
fs.rmdirSync(dirname);
|
|
|
|
var proc = spawn(process.execPath, ['--interactive']);
|
|
proc.stdout.pipe(process.stdout);
|
|
proc.stderr.pipe(process.stderr);
|
|
proc.stdin.write('require("path");\n');
|
|
proc.stdin.write('process.exit(42);\n');
|
|
|
|
proc.once('exit', common.mustCall(function(exitCode, signalCode) {
|
|
assert.equal(exitCode, 42);
|
|
assert.equal(signalCode, null);
|
|
}));
|