0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-domain-crypto.js
Sakthipriyan Vairamani 80a1cf7425 test: fix messages and use return to skip tests
This is a followup of https://github.com/nodejs/io.js/pull/2109.
The tests which didn't make it in #2109, are included in this patch.
The skip messages are supposed to follow the format

    1..0 # Skipped: [Actual reason why the test is skipped]

and the tests should be skipped with the return statement.

PR-URL: https://github.com/nodejs/io.js/pull/2290
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-08-03 21:32:48 +05:30

18 lines
494 B
JavaScript

/* eslint-disable strict */
try {
var crypto = require('crypto');
} catch (e) {
console.log('1..0 # Skipped: node compiled without OpenSSL.');
return;
}
// the missing var keyword is intentional
domain = require('domain');
// should not throw a 'TypeError: undefined is not a function' exception
crypto.randomBytes(8);
crypto.randomBytes(8, function() {});
crypto.pseudoRandomBytes(8);
crypto.pseudoRandomBytes(8, function() {});
crypto.pbkdf2('password', 'salt', 8, 8, function() {});