1'use strict'; 2const common = require('../common'); 3if (!common.hasCrypto) 4 common.skip('missing crypto'); 5const assert = require('assert'); 6const child_process = require('child_process'); 7const path = require('path'); 8 9process.env.NODE_DEBUG_NATIVE = 'http2'; 10process.env.NODE_DEBUG = 'http2'; 11const { stdout, stderr } = child_process.spawnSync(process.execPath, [ 12 path.resolve(__dirname, 'test-http2-ping.js'), 13], { encoding: 'utf8' }); 14 15assert(stderr.match(/Setting the NODE_DEBUG environment variable to 'http2' can expose sensitive data \(such as passwords, tokens and authentication headers\) in the resulting log\.\r?\n/), 16 stderr); 17assert(stderr.match(/Http2Session client \(\d+\) handling data frame for stream \d+\r?\n/), 18 stderr); 19assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] reading starting\r?\n/), 20 stderr); 21assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] closed with code 0\r?\n/), 22 stderr); 23assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] closed with code 0\r?\n/), 24 stderr); 25assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] tearing down stream\r?\n/), 26 stderr); 27assert.strictEqual(stdout.trim(), ''); 28