forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc,test: specify and test CLI option precedence rules
Refs: nodejs#35098 (comment) PR-URL: nodejs#35106 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
require('../common'); | ||
const assert = require('assert'); | ||
const { spawnSync } = require('child_process'); | ||
|
||
// The last option on the command line takes precedence: | ||
assert.strictEqual(spawnSync(process.execPath, [ | ||
'--max-http-header-size=1234', | ||
'--max-http-header-size=5678', | ||
'-p', 'http.maxHeaderSize' | ||
], { | ||
encoding: 'utf8' | ||
}).stdout.trim(), '5678'); | ||
|
||
// The command line takes precedence over NODE_OPTIONS: | ||
assert.strictEqual(spawnSync(process.execPath, [ | ||
'--max-http-header-size=5678', | ||
'-p', 'http.maxHeaderSize' | ||
], { | ||
encoding: 'utf8', | ||
env: { ...process.env, NODE_OPTIONS: '--max-http-header-size=1234' } | ||
}).stdout.trim(), '5678'); |