node/test/parallel/test-http2-noflag.js
Daniel Bevenius 50ebac1124
tools: add eslint rule for hasCrypto checking
The motivation for this commit is to pick up early on missing checks for
crypto support (when Node is built --without-ssl).

There are currently usages of common.hasCrypto which are not just for
detecting if crypto support is available and then skip the test in
question. For these case we still want to have a lint error generated
which can then be disabled using an ESLint comment.

PR-URL: https://github.com/nodejs/node/pull/13813
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-08-30 18:02:58 -03:00

9 lines
238 B
JavaScript

// The --expose-http2 flag is not set
'use strict';
require('../common');
const assert = require('assert');
assert.throws(() => require('http2'), // eslint-disable-line crypto-check
/^Error: Cannot find module 'http2'$/);