diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-03-20 12:39:46 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-03-26 10:29:34 +0200 |
commit | 8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956 (patch) | |
tree | 76c01165a604c4785043224d8b815984e2cda9b2 /test/parallel/test-crypto-authenticated.js | |
parent | ebbf3936001969905ce28dc588b2c71c3b65c146 (diff) | |
download | node-new-8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956.tar.gz |
test: add deprecation code to expectWarning
This commit adds a deprecation code to expectWarning and updates the
function to check the passed code against the code property on the
warning object.
Not all warnings have a deprecation code so for those that don't an
explicit code of common.noWarnCode is required. Passing this skips the
assertion of the code.
PR-URL: https://github.com/nodejs/node/pull/19474
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test/parallel/test-crypto-authenticated.js')
-rw-r--r-- | test/parallel/test-crypto-authenticated.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index c016b3500d..9979a1b861 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -336,13 +336,16 @@ const errMessages = { const ciphers = crypto.getCiphers(); const expectedWarnings = common.hasFipsCrypto ? - [] : ['Use Cipheriv for counter mode of aes-192-gcm']; + [] : [['Use Cipheriv for counter mode of aes-192-gcm', + common.noWarnCode]]; const expectedDeprecationWarnings = [0, 1, 2, 6, 9, 10, 11, 17] - .map((i) => `Permitting authentication tag lengths of ${i} bytes is ` + - 'deprecated. Valid GCM tag lengths are 4, 8, 12, 13, 14, 15, 16.'); + .map((i) => [`Permitting authentication tag lengths of ${i} bytes is ` + + 'deprecated. Valid GCM tag lengths are 4, 8, 12, 13, 14, 15, 16.', + 'DEP0090']); -expectedDeprecationWarnings.push('crypto.DEFAULT_ENCODING is deprecated.'); +expectedDeprecationWarnings.push(['crypto.DEFAULT_ENCODING is deprecated.', + 'DEP0091']); common.expectWarning({ Warning: expectedWarnings, |