mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 23:43:09 +01:00
79c865a53f
This patch uses `return` statement to skip the test instead of using `process.exit` call. PR-URL: https://github.com/nodejs/io.js/pull/2109 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
30 lines
574 B
JavaScript
30 lines
574 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
if (!common.hasCrypto) {
|
|
console.log('1..0 # Skipped: missing crypto');
|
|
return;
|
|
}
|
|
var https = require('https');
|
|
|
|
var http = require('http');
|
|
var gotHttpsResp = false;
|
|
var gotHttpResp = false;
|
|
|
|
process.on('exit', function() {
|
|
assert(gotHttpsResp);
|
|
assert(gotHttpResp);
|
|
console.log('ok');
|
|
});
|
|
|
|
https.get('https://www.google.com/', function(res) {
|
|
gotHttpsResp = true;
|
|
res.resume();
|
|
});
|
|
|
|
http.get('http://www.google.com/', function(res) {
|
|
gotHttpResp = true;
|
|
res.resume();
|
|
});
|