test: move require http2 to after crypto check

Currently test-http2-client-write-empty-string.js will throw "Error
[ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support"
when configured --without-ssl.

This commit moves the require of http2 to after the crypto check to
avoid this error.

PR-URL: https://github.com/nodejs/node/pull/19111
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
This commit is contained in:
Daniel Bevenius authored and Myles Borins committed 2018-03-07 09:30:19 -08:00
1 parent 2f17c52674
commit ee653ecd09
1 file changed
+2 -1
@@ -1,12 +1,13 @@
'use strict';
const assert = require('assert');
const http2 = require('http2');
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const http2 = require('http2');
for (const chunkSequence of [
[ '' ],
[ '', '' ]