mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
2d2986ae72
* 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>
21 lines
816 B
JavaScript
21 lines
816 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
const tls = require('tls');
|
|
|
|
common.expectWarning('DeprecationWarning', [
|
|
'crypto.Credentials is deprecated. Use tls.SecureContext instead.',
|
|
'crypto.createCredentials is deprecated. Use tls.createSecureContext instead.'
|
|
]);
|
|
|
|
// Accessing the deprecated function is enough to trigger the warning event.
|
|
// It does not need to be called. So the assert serves the purpose of both
|
|
// triggering the warning event and confirming that the deprected function is
|
|
// mapped to the correct non-deprecated function.
|
|
assert.strictEqual(crypto.Credentials, tls.SecureContext);
|
|
assert.strictEqual(crypto.createCredentials, tls.createSecureContext);
|