diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index 5307ea4f6f9e05..da532d7657cb61 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -8,6 +8,14 @@ if (!common.hasCrypto) { } var crypto = require('crypto'); +// Test for binding layer robustness +{ + const binding = process.binding('crypto'); + const h = new binding.Hmac(); + // Fail to init the Hmac with an algorithm. + assert.throws(() => h.update('hello'), /^TypeError: HmacUpdate fail$/); +} + // Test HMAC var h1 = crypto.createHmac('sha1', 'Node') .update('some data')