@@ -16,7 +16,7 @@ describe("Proxy Tests", function () {
1616 var port = 8902 ;
1717 var listenOptions = {
1818 port : port ,
19- ip : ' 127.0.0.1'
19+ ip : " 127.0.0.1" ,
2020 } ;
2121 var testPort = port + 10 ;
2222 var proxy ;
@@ -344,7 +344,7 @@ describe("Proxy Tests", function () {
344344
345345 it ( "custom error target" , function ( done ) {
346346 var listenOptions = {
347- port : 55550
347+ port : 55550 ,
348348 } ;
349349 util
350350 . setupProxy ( listenOptions , { errorTarget : "http://127.0.0.1:55565" } , [ ] )
@@ -413,7 +413,7 @@ describe("Proxy Tests", function () {
413413
414414 it ( "backend error" , function ( done ) {
415415 var listenOptions = {
416- port : 55550
416+ port : 55550 ,
417417 } ;
418418 util
419419 . setupProxy ( listenOptions , { errorTarget : "http://127.0.0.1:55565" } , [ ] )
@@ -443,7 +443,7 @@ describe("Proxy Tests", function () {
443443
444444 it ( "Redirect location with rewriting" , function ( done ) {
445445 var listenOptions = {
446- port : 55556
446+ port : 55556 ,
447447 } ;
448448 var options = {
449449 protocolRewrite : "https" ,
@@ -467,7 +467,9 @@ describe("Proxy Tests", function () {
467467 )
468468 )
469469 . then ( ( ) =>
470- fetch ( "http://127.0.0.1:" + listenOptions . port + "/external/urlpath/" , { redirect : "manual" } )
470+ fetch ( "http://127.0.0.1:" + listenOptions . port + "/external/urlpath/" , {
471+ redirect : "manual" ,
472+ } )
471473 )
472474 . then ( ( res ) => {
473475 expect ( res . status ) . toEqual ( 301 ) ;
@@ -495,7 +497,7 @@ describe("Proxy Tests", function () {
495497 return ;
496498 }
497499 var listenOptions = {
498- port : 55556
500+ port : 55556 ,
499501 } ;
500502 var testPort = listenOptions . port + 20 ;
501503 var options = {
@@ -527,16 +529,14 @@ describe("Proxy Tests", function () {
527529 } ) ;
528530} ) ;
529531
530-
531-
532532describe ( "Proxy Tests with Unix socket" , function ( ) {
533533 var listenOptions = {
534- socket : ' /tmp/test.sock' ,
534+ socket : " /tmp/test.sock" ,
535535 } ;
536- var requestOptions = new URL ( ' http://localhost' )
536+ var requestOptions = new URL ( " http://localhost" ) ;
537537 requestOptions . socketPath = listenOptions . socket ;
538538 var proxy ;
539-
539+
540540 beforeEach ( function ( callback ) {
541541 util . setupProxy ( listenOptions ) . then ( function ( newProxy ) {
542542 proxy = newProxy ;
@@ -547,14 +547,15 @@ describe("Proxy Tests with Unix socket", function () {
547547 afterEach ( function ( callback ) {
548548 util . teardownServers ( callback ) ;
549549 } ) ;
550-
550+
551551 it ( "unix socket HTTP request" , function ( done ) {
552- http . request ( requestOptions , res => {
552+ http
553+ . request ( requestOptions , ( res ) => {
553554 let recvData = [ ] ;
554- res . on ( ' data' , chunk => {
555+ res . on ( " data" , ( chunk ) => {
555556 recvData . push ( chunk ) ;
556557 } ) ;
557- res . on ( ' end' , ( ) => {
558+ res . on ( " end" , ( ) => {
558559 const body = JSON . parse ( Buffer . concat ( recvData ) . toString ( ) ) ;
559560 expect ( body ) . toEqual (
560561 jasmine . objectContaining ( {
@@ -566,10 +567,12 @@ describe("Proxy Tests with Unix socket", function () {
566567 expect ( route . last_activity ) . toBeGreaterThan ( proxy . _setup_timestamp ) ;
567568 done ( ) ;
568569 } ) ;
569- } ) . on ( 'error' , err => {
570- console . log ( 'Error: ' , err . message ) ;
570+ } )
571+ . on ( "error" , ( err ) => {
572+ console . log ( "Error: " , err . message ) ;
571573 expect ( "error" ) . toEqual ( "ok" ) ;
572- } ) . end ( ) ;
574+ } )
575+ . end ( ) ;
573576 } ) ;
574577
575578 it ( "unix socket WebSocket request" , function ( done ) {
@@ -605,5 +608,4 @@ describe("Proxy Tests with Unix socket", function () {
605608 ws . send ( "hi" ) ;
606609 } ) ;
607610 } ) ;
608-
609- } ) ;
611+ } ) ;
0 commit comments