Skip to content

Commit f00790a

Browse files
Potential fix for code scanning alert no. 374: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent ee8c7f5 commit f00790a

File tree

1 file changed

+3
-3
lines changed
  • dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration

1 file changed

+3
-3
lines changed

dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('onUnhandledRejectionIntegration', () => {
1515

1616
const testScriptPath = path.resolve(__dirname, 'mode-warn-string.js');
1717

18-
childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout, stderr) => {
18+
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout, stderr) => {
1919
expect(err).toBeNull();
2020
expect(stdout).toBe("I'm alive!");
2121
expect(stderr.trim())
@@ -31,7 +31,7 @@ test rejection`);
3131

3232
const testScriptPath = path.resolve(__dirname, 'mode-warn-error.js');
3333

34-
childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout, stderr) => {
34+
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout, stderr) => {
3535
expect(err).toBeNull();
3636
expect(stdout).toBe("I'm alive!");
3737
expect(stderr)
@@ -48,7 +48,7 @@ Error: test rejection
4848

4949
const testScriptPath = path.resolve(__dirname, 'mode-strict.js');
5050

51-
childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout, stderr) => {
51+
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout, stderr) => {
5252
expect(err).not.toBeNull();
5353
expect(err?.code).toBe(1);
5454
expect(stdout).not.toBe("I'm alive!");

0 commit comments

Comments
 (0)