@@ -26,23 +26,23 @@ describe("router", () => {
2626 } ) ;
2727
2828 it ( "returns 405 for non-POST methods" , async ( ) => {
29- const request = new Request ( "https://example.com" , { method : "GET" } ) ;
29+ const request = new Request ( "https://example.com/webhook " , { method : "GET" } ) ;
3030 const response = await router ( request , mockEnv as any , { } as any ) ;
3131
3232 expect ( response . status ) . toBe ( 405 ) ;
3333 expect ( await response . text ( ) ) . toBe ( "Method Not Allowed" ) ;
3434 } ) ;
3535
3636 it ( "returns 400 if signature is missing" , async ( ) => {
37- const request = new Request ( "https://example.com" , { method : "POST" } ) ;
37+ const request = new Request ( "https://example.com/webhook " , { method : "POST" } ) ;
3838 const response = await router ( request , mockEnv as any , { } as any ) ;
3939
4040 expect ( response . status ) . toBe ( 400 ) ;
4141 expect ( await response . text ( ) ) . toBe ( "Missing signature" ) ;
4242 } ) ;
4343
4444 it ( "returns 401 if signature is invalid" , async ( ) => {
45- const request = new Request ( "https://example.com" , {
45+ const request = new Request ( "https://example.com/webhook " , {
4646 method : "POST" ,
4747 headers : { "x-line-signature" : "invalid" } ,
4848 body : JSON . stringify ( { } ) ,
@@ -55,7 +55,7 @@ describe("router", () => {
5555
5656 it ( "returns 500 if server is misconfigured" , async ( ) => {
5757 mockEnv . LINE_CHANNEL_SECRET = null ;
58- const request = new Request ( "https://example.com" , { method : "POST" } ) ;
58+ const request = new Request ( "https://example.com/webhook " , { method : "POST" } ) ;
5959 const response = await router ( request , mockEnv as any , { } as any ) ;
6060
6161 expect ( response . status ) . toBe ( 500 ) ;
@@ -65,7 +65,7 @@ describe("router", () => {
6565 it ( "returns 200 for a valid signed request" , async ( ) => {
6666 const rawBody = JSON . stringify ( { destination : "" , events : [ ] } ) ;
6767 const signature = await hmacSHA256Base64 ( "secret" , rawBody ) ;
68- const request = new Request ( "https://example.com" , {
68+ const request = new Request ( "https://example.com/webhook " , {
6969 method : "POST" ,
7070 headers : { "x-line-signature" : signature } ,
7171 body : rawBody ,
0 commit comments