node/test/parallel/test-http2-debug.js
Daniel Bevenius f86a181d47 test: add crypto check to test-http2-debug
This commit adds a crypto check to test-http2-debug.js as it currently
will error if configured --without-ssl.

The issue here is that the while the test spawns a child process that
runs test-http2-ping.js, which does have a crypto check, it will just
print '1..0 # Skipped: missing crypto' to stdout, and nothing to stderr
which is what this test is trying to assert and hence failing.

PR-URL: https://github.com/nodejs/node/pull/21205
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-06-11 05:34:36 +02:00

21 lines
776 B
JavaScript

'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const child_process = require('child_process');
const path = require('path');
process.env.NODE_DEBUG_NATIVE = 'http2';
const { stdout, stderr } = child_process.spawnSync(process.execPath, [
path.resolve(__dirname, 'test-http2-ping.js')
], { encoding: 'utf8' });
assert(stderr.match(/Http2Session client \(\d+\) handling data frame for stream \d+/),
stderr);
assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] reading starting/),
stderr);
assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] tearing down stream/),
stderr);
assert.strictEqual(stdout.trim(), '');