0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
nodejs/test/internet/test-http-https-default-ports.js
Sakthipriyan Vairamani 79c865a53f test: changing process.exit to return while skipping tests
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>
2015-07-20 15:50:42 +05:30

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();
});