diff options
Diffstat (limited to 'test/simple/test-crypto.js')
-rw-r--r-- | test/simple/test-crypto.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/simple/test-crypto.js b/test/simple/test-crypto.js index cdf066c3b9..eb33aef92b 100644 --- a/test/simple/test-crypto.js +++ b/test/simple/test-crypto.js @@ -70,6 +70,16 @@ try { process.exit(); } +// 'this' safety +// https://github.com/joyent/node/issues/6690 +assert.throws(function() { + var options = {key: keyPem, cert: certPem, ca: caPem}; + var credentials = crypto.createCredentials(options); + var context = credentials.context; + var notcontext = { setOptions: context.setOptions, setKey: context.setKey }; + crypto.createCredentials({ secureOptions: 1 }, notcontext); +}, TypeError); + // PFX tests assert.doesNotThrow(function() { crypto.createSecureContext({pfx:certPfx, passphrase:'sample'}); |