Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit facd7da

Browse filesBrowse files
princejwesleycjihrig
authored andcommitted
test: don't hard code deprecation count
PR-URL: #7927 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7d0c1bf commit facd7da
Copy full SHA for facd7da

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-crypto-deprecated.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-deprecated.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ if (!common.hasCrypto) {
99
const crypto = require('crypto');
1010
const tls = require('tls');
1111

12+
const expected = [
13+
'crypto.Credentials is deprecated. Use tls.SecureContext instead.',
14+
'crypto.createCredentials is deprecated. Use tls.createSecureContext instead.'
15+
];
16+
1217
process.on('warning', common.mustCall((warning) => {
1318
assert.strictEqual(warning.name, 'DeprecationWarning');
1419
assert.notStrictEqual(expected.indexOf(warning.message), -1,
1520
`unexpected error message: "${warning.message}"`);
1621
// Remove a warning message after it is seen so that we guarantee that we get
1722
// each message only once.
1823
expected.splice(expected.indexOf(warning.message), 1);
19-
}, 2));
20-
21-
var expected = [
22-
'crypto.Credentials is deprecated. Use tls.SecureContext instead.',
23-
'crypto.createCredentials is deprecated. Use tls.createSecureContext instead.'
24-
];
24+
}, expected.length));
2525

2626
// Accessing the deprecated function is enough to trigger the warning event.
2727
// It does not need to be called. So the assert serves the purpose of both

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.