File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change 2020// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
2222'use strict' ;
23- require ( '../common' ) ;
24- const assert = require ( 'assert' ) ;
25-
23+ const common = require ( '../common' ) ;
2624const http = require ( 'http' ) ;
2725
28- let serverRequests = 0 ;
29- let clientRequests = 0 ;
30-
31- const server = http . createServer ( function ( req , res ) {
32- serverRequests ++ ;
26+ const server = http . createServer ( common . mustCall ( function ( req , res ) {
3327 res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
3428 res . end ( 'OK' ) ;
35- } ) ;
29+ } ) ) ;
3630
3731server . listen ( 0 , function ( ) {
3832 function callback ( ) { }
@@ -44,10 +38,9 @@ server.listen(0, function() {
4438 } , function ( res ) {
4539 req . clearTimeout ( callback ) ;
4640
47- res . on ( 'end' , function ( ) {
48- clientRequests ++ ;
41+ res . on ( 'end' , common . mustCall ( function ( ) {
4942 server . close ( ) ;
50- } ) ;
43+ } ) ) ;
5144
5245 res . resume ( ) ;
5346 } ) ;
@@ -56,8 +49,3 @@ server.listen(0, function() {
5649 req . setTimeout ( 0xffffffff , callback ) ;
5750 req . end ( ) ;
5851} ) ;
59-
60- process . once ( 'exit' , function ( ) {
61- assert . strictEqual ( clientRequests , 1 ) ;
62- assert . strictEqual ( serverRequests , 1 ) ;
63- } ) ;
You can’t perform that action at this time.
0 commit comments