mirror of
https://github.com/nodejs/node.git
synced 2025-05-12 14:37:22 +00:00

While `child_process.execFile()` gets called in places in the test suite, there are no explicit test for it and there are parts of the implementation that are not covered by tests. This adds a minimal test that increases (but does not complete) coverage for the implementation. PR-URL: https://github.com/nodejs/node/pull/11929 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
22 lines
540 B
JavaScript
22 lines
540 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const execFile = require('child_process').execFile;
|
|
const path = require('path');
|
|
|
|
const fixture = path.join(common.fixturesDir, 'exit.js');
|
|
|
|
{
|
|
execFile(
|
|
process.execPath,
|
|
[fixture, 42],
|
|
common.mustCall((e) => {
|
|
// Check that arguments are included in message
|
|
assert.strictEqual(e.message.trim(),
|
|
`Command failed: ${process.execPath} ${fixture} 42`);
|
|
assert.strictEqual(e.code, 42);
|
|
})
|
|
);
|
|
}
|