node/test/parallel/test-process-execve-no-args.js
Antoine du Hamel 634dc26605
test: ensure assertions are reached on all tests
PR-URL: https://github.com/nodejs/node/pull/60845
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-11-27 09:35:25 +00:00

26 lines
779 B
JavaScript

'use strict';
const { skip, isWindows, isIBMi } = require('../common');
const assert = require('assert');
const { isMainThread } = require('worker_threads');
const { dirname, join } = require('path');
const { existsSync } = require('fs');
if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}
// Get full path to the executable used for the test
const executable = join(dirname(process.execPath), 'nop');
// Sanity check that the binary exists
if (!existsSync(executable)) {
skip(executable + ' binary is not available');
}
process.execve(executable);
// If process.execve succeeds, this should never be executed.
assert.fail('process.execve failed');