Skip to content

Commit dc1a021

Browse files
committed
test: fix expectWarning conflict in test-crypto-hmac
The existing inline `expectWarning` block at the bottom of the file overwrites the top-of-file registration added by the previous commit, because `expectWarning` stores expectations keyed by warning name (`DeprecationWarning`) and the second call replaces the first. Consolidate both DEP0181 and DEP0206 expectations into the single top-of-file call and drop the now-redundant inline block. The `crypto.Hmac('sha256', 'Node')` call earlier in the file already exercises the constructor-without-`new` path that triggers DEP0181.
1 parent b7bc8a8 commit dc1a021

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

test/parallel/test-crypto-hmac.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const crypto = require('crypto');
99

1010
common.expectWarning({
1111
DeprecationWarning: {
12+
DEP0181: 'crypto.Hmac constructor is deprecated.',
1213
DEP0206: 'Calling digest() on an already-finalized Hmac instance is deprecated.',
1314
},
1415
});
@@ -466,13 +467,3 @@ assert.strictEqual(
466467
crypto.createHmac('sha256', keyObject).update('foo').digest(),
467468
);
468469
}
469-
470-
{
471-
crypto.Hmac('sha256', 'Node');
472-
common.expectWarning({
473-
DeprecationWarning: [
474-
['crypto.Hmac constructor is deprecated.',
475-
'DEP0181'],
476-
]
477-
});
478-
}

0 commit comments

Comments
 (0)