forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: validate no debug info for http2
Refs: nodejs#31763 This test would have helped us catch the noisy output from http2 earlier. Currently none of the tests fail if there is unexpected debug output. Signed-off-by: Michael Dawson <[email protected]>
- Loading branch information
Showing
1 changed file
with
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
const { | ||
hasCrypto, | ||
mustCall, | ||
skip | ||
} = require('../common'); | ||
if (!hasCrypto) | ||
skip('missing crypto'); | ||
|
||
const { | ||
strictEqual | ||
} = require('assert'); | ||
const { | ||
createServer, | ||
connect | ||
} = require('http2'); | ||
const { | ||
spawnSync | ||
} = require('child_process'); | ||
|
||
// Validate that there is no unexpected output when | ||
// using http2 | ||
if (process.argv[2] !== 'child') { | ||
const { | ||
stdout, stderr, status | ||
} = spawnSync(process.execPath, [__filename, 'child'], { encoding: 'utf8' }); | ||
strictEqual(stderr, ''); | ||
strictEqual(stdout, ''); | ||
strictEqual(status, 0); | ||
} else { | ||
const server = createServer(); | ||
server.listen(0, mustCall(() => { | ||
const client = connect(`http://localhost:${server.address().port}`); | ||
client.on('connect', mustCall(() => { | ||
client.close(); | ||
server.close(); | ||
})); | ||
})); | ||
} |