mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
test: refactor test-https-set-timeout-server
* Add common.mustCall() for error handlers. * Alphabetize modules PR-URL: https://github.com/nodejs/node/pull/13032 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
This commit is contained in:
1 parent
6bfdeedce5
commit
658741b9d9
1 file changed
+7
-7
@@ -21,16 +21,16 @@
|
||||
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
|
||||
if (!common.hasCrypto) {
|
||||
common.skip('missing crypto');
|
||||
return;
|
||||
}
|
||||
const https = require('https');
|
||||
|
||||
const tls = require('tls');
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const https = require('https');
|
||||
const tls = require('tls');
|
||||
|
||||
const tests = [];
|
||||
|
||||
@@ -69,7 +69,7 @@ test(function serverTimeout(cb) {
|
||||
https.get({
|
||||
port: this.address().port,
|
||||
rejectUnauthorized: false
|
||||
}).on('error', common.noop);
|
||||
}).on('error', common.mustCall());
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -90,7 +90,7 @@ test(function serverRequestTimeout(cb) {
|
||||
method: 'POST',
|
||||
rejectUnauthorized: false
|
||||
});
|
||||
req.on('error', common.noop);
|
||||
req.on('error', common.mustCall());
|
||||
req.write('Hello');
|
||||
// req is in progress
|
||||
});
|
||||
@@ -111,7 +111,7 @@ test(function serverResponseTimeout(cb) {
|
||||
https.get({
|
||||
port: this.address().port,
|
||||
rejectUnauthorized: false
|
||||
}).on('error', common.noop);
|
||||
}).on('error', common.mustCall());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ test(function serverRequestNotTimeoutAfterEnd(cb) {
|
||||
https.get({
|
||||
port: this.address().port,
|
||||
rejectUnauthorized: false
|
||||
}).on('error', common.noop);
|
||||
}).on('error', common.mustCall());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user