mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 15:46:27 +00:00

* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
31 lines
812 B
JavaScript
31 lines
812 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const spawn = require('child_process').spawn;
|
|
const defaultCoreList = require('crypto').constants.defaultCoreCipherList;
|
|
|
|
function doCheck(arg, check) {
|
|
let out = '';
|
|
arg = arg.concat([
|
|
'-pe',
|
|
'require("crypto").constants.defaultCipherList'
|
|
]);
|
|
spawn(process.execPath, arg, {})
|
|
.on('error', common.mustNotCall())
|
|
.stdout.on('data', function(chunk) {
|
|
out += chunk;
|
|
}).on('end', function() {
|
|
assert.strictEqual(out.trim(), check);
|
|
}).on('error', common.mustNotCall());
|
|
}
|
|
|
|
// test the default unmodified version
|
|
doCheck([], defaultCoreList);
|
|
|
|
// test the command line switch by itself
|
|
doCheck(['--tls-cipher-list=ABC'], 'ABC');
|