@@ -557,7 +557,7 @@ describe("proxy option", () => {
557557
558558 const proxy = express ( ) ;
559559
560- proxy . get ( "*" , ( proxyReq , res ) => {
560+ proxy . get ( "*slug " , ( proxyReq , res ) => {
561561 res . send ( "from proxy" ) ;
562562 } ) ;
563563
@@ -692,7 +692,7 @@ describe("proxy option", () => {
692692
693693 // This forces Express to try to decode URLs, which is needed for the test
694694 // associated with the middleware below.
695- proxy . all ( "*" , ( _req , res , next ) => {
695+ proxy . all ( "*slug " , ( _req , res , next ) => {
696696 next ( ) ;
697697 } ) ;
698698 // We must define all 4 params in order for this to be detected as an
@@ -831,7 +831,7 @@ describe("proxy option", () => {
831831 } ) ;
832832 } ) ;
833833
834- describe ( "should work and respect `logProvider` and `logLevel` options " , ( ) => {
834+ describe ( "should work and respect `logger` option " , ( ) => {
835835 let server ;
836836 let req ;
837837 let customLogProvider ;
@@ -853,8 +853,7 @@ describe("proxy option", () => {
853853 {
854854 context : "/my-path" ,
855855 target : "http://unknown:1234" ,
856- logProvider : ( ) => customLogProvider ,
857- logLevel : "error" ,
856+ logger : customLogProvider ,
858857 } ,
859858 ] ,
860859 port : port3 ,
@@ -878,59 +877,7 @@ describe("proxy option", () => {
878877 it ( "respects a proxy option when a request path is matched" , async ( ) => {
879878 await req . get ( "/my-path" ) ;
880879
881- expect ( customLogProvider . error ) . toHaveBeenCalledTimes ( 1 ) ;
882- } ) ;
883- } ) ;
884- } ) ;
885-
886- describe ( "should work and respect the `logLevel` option with `silent` value" , ( ) => {
887- let server ;
888- let req ;
889- let customLogProvider ;
890-
891- beforeAll ( async ( ) => {
892- customLogProvider = {
893- log : jest . fn ( ) ,
894- debug : jest . fn ( ) ,
895- info : jest . fn ( ) ,
896- warn : jest . fn ( ) ,
897- error : jest . fn ( ) ,
898- } ;
899-
900- const compiler = webpack ( [ config , config ] ) ;
901-
902- server = new Server (
903- {
904- proxy : [
905- {
906- context : "my-path" ,
907- target : "http://unknown:1234" ,
908- logProvider : ( ) => customLogProvider ,
909- logLevel : "silent" ,
910- } ,
911- ] ,
912- port : port3 ,
913- } ,
914- compiler ,
915- ) ;
916-
917- await server . start ( ) ;
918-
919- await listenProxyServers ( ) ;
920-
921- req = request ( server . app ) ;
922- } ) ;
923-
924- afterAll ( async ( ) => {
925- await server . stop ( ) ;
926- await closeProxyServers ( ) ;
927- } ) ;
928-
929- describe ( "target" , ( ) => {
930- it ( "respects a proxy option when a request path is matched" , async ( ) => {
931- await req . get ( "/my-path" ) ;
932-
933- expect ( customLogProvider . error ) . toHaveBeenCalledTimes ( 0 ) ;
880+ expect ( customLogProvider . info ) . toHaveBeenCalledTimes ( 1 ) ;
934881 } ) ;
935882 } ) ;
936883 } ) ;
@@ -960,7 +907,7 @@ describe("proxy option", () => {
960907 {
961908 context : "/my-path" ,
962909 target : "http://unknown:1234" ,
963- logProvider : ( ) => customLogProvider ,
910+ logger : customLogProvider ,
964911 } ,
965912 ] ,
966913 port : port3 ,
@@ -1014,7 +961,7 @@ describe("proxy option", () => {
1014961 {
1015962 context : "/my-path" ,
1016963 target : "http://unknown:1234" ,
1017- logProvider : ( ) => customLogProvider ,
964+ logger : customLogProvider ,
1018965 } ,
1019966 ] ,
1020967 port : port3 ,
0 commit comments