11import {
2- withOAuth ,
3- withLogging ,
4- applyMiddleware ,
5- createMiddleware ,
2+ withOAuth ,
3+ withLogging ,
4+ applyMiddlewares ,
5+ createMiddleware ,
66} from "./middleware.js" ;
77import { OAuthClientProvider } from "./auth.js" ;
88import { FetchLike } from "../shared/transport.js" ;
@@ -677,7 +677,7 @@ describe("applyMiddleware", () => {
677677 const response = new Response ( "success" , { status : 200 } ) ;
678678 mockFetch . mockResolvedValue ( response ) ;
679679
680- const composedFetch = applyMiddleware ( ) ( mockFetch ) ;
680+ const composedFetch = applyMiddlewares ( ) ( mockFetch ) ;
681681
682682 expect ( composedFetch ) . toBe ( mockFetch ) ;
683683 } ) ;
@@ -694,7 +694,7 @@ describe("applyMiddleware", () => {
694694 return next ( input , { ...init , headers } ) ;
695695 } ;
696696
697- const composedFetch = applyMiddleware ( middleware1 ) ( mockFetch ) ;
697+ const composedFetch = applyMiddlewares ( middleware1 ) ( mockFetch ) ;
698698
699699 await composedFetch ( "https://api.example.com/data" ) ;
700700
@@ -736,7 +736,7 @@ describe("applyMiddleware", () => {
736736 return next ( input , { ...init , headers } ) ;
737737 } ;
738738
739- const composedFetch = applyMiddleware (
739+ const composedFetch = applyMiddlewares (
740740 middleware1 ,
741741 middleware2 ,
742742 middleware3 ,
@@ -765,7 +765,7 @@ describe("applyMiddleware", () => {
765765
766766 // Use custom logger to avoid console output
767767 const mockLogger = jest . fn ( ) ;
768- const composedFetch = applyMiddleware (
768+ const composedFetch = applyMiddlewares (
769769 oauthMiddleware ,
770770 withLogging ( { logger : mockLogger , statusLevel : 0 } ) ,
771771 ) ( mockFetch ) ;
@@ -803,7 +803,7 @@ describe("applyMiddleware", () => {
803803 const originalError = new Error ( "Network failure" ) ;
804804 mockFetch . mockRejectedValue ( originalError ) ;
805805
806- const composedFetch = applyMiddleware ( errorMiddleware ) ( mockFetch ) ;
806+ const composedFetch = applyMiddlewares ( errorMiddleware ) ( mockFetch ) ;
807807
808808 await expect ( composedFetch ( "https://api.example.com/data" ) ) . rejects . toThrow (
809809 "Middleware error: Network failure" ,
@@ -853,7 +853,7 @@ describe("Integration Tests", () => {
853853
854854 // Use custom logger to avoid console output
855855 const mockLogger = jest . fn ( ) ;
856- const enhancedFetch = applyMiddleware (
856+ const enhancedFetch = applyMiddlewares (
857857 withOAuth (
858858 mockProvider as OAuthClientProvider ,
859859 "https://mcp-server.example.com" ,
@@ -903,7 +903,7 @@ describe("Integration Tests", () => {
903903
904904 // Use custom logger to avoid console output
905905 const mockLogger = jest . fn ( ) ;
906- const enhancedFetch = applyMiddleware (
906+ const enhancedFetch = applyMiddlewares (
907907 withOAuth (
908908 mockProvider as OAuthClientProvider ,
909909 "https://streamable-server.example.com" ,
@@ -971,7 +971,7 @@ describe("Integration Tests", () => {
971971
972972 // Use custom logger to avoid console output
973973 const mockLogger = jest . fn ( ) ;
974- const enhancedFetch = applyMiddleware (
974+ const enhancedFetch = applyMiddlewares (
975975 withOAuth (
976976 mockProvider as OAuthClientProvider ,
977977 "https://mcp-server.example.com" ,
@@ -1177,7 +1177,7 @@ describe("createMiddleware", () => {
11771177 } ) ;
11781178
11791179 // Compose with existing middleware
1180- const enhancedFetch = applyMiddleware (
1180+ const enhancedFetch = applyMiddlewares (
11811181 customAuth ,
11821182 customLogging ,
11831183 withLogging ( { statusLevel : 400 } ) ,
0 commit comments