node/test/sequential/test-process-title.js
Antoine du Hamel 646e19e2b4
test: ensure assertions are reachable in test/sequential
PR-URL: https://github.com/nodejs/node/pull/60412
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-10-29 16:29:39 +01:00

23 lines
835 B
JavaScript

'use strict';
const common = require('../common');
const { spawnSync } = require('child_process');
const assert = require('assert');
// FIXME add sunos support
if (common.isSunOS)
common.skip(`Unsupported platform [${process.platform}]`);
// FIXME add IBMi support
if (common.isIBMi)
common.skip('Unsupported platform IBMi');
// Explicitly assigning to process.title before starting the child process
// is necessary otherwise *its* process.title is whatever the last
// SetConsoleTitle() call in our process tree set it to.
// Can be removed when https://github.com/libuv/libuv/issues/2667 is fixed.
if (common.isWindows)
process.title = process.execPath;
const xs = 'x'.repeat(1024);
const proc = spawnSync(process.execPath, ['-p', 'process.title', xs]);
assert.strictEqual(proc.stdout.toString().trim(), process.execPath);