@@ -3,7 +3,7 @@ import { Hono, MiddlewareHandler } from 'hono';
33import superjson from 'superjson' ;
44import { describe , expect , it } from 'vitest' ;
55import { createHonoHandler } from '../../src/adapter/hono' ;
6- import { RPCApiHandler } from '../../src/api' ;
6+ import { RestApiHandler , RPCApiHandler } from '../../src/api' ;
77import { makeUrl , schema } from '../utils' ;
88
99describe ( 'Hono adapter tests - rpc handler' , ( ) => {
@@ -86,20 +86,13 @@ describe('Hono adapter tests - rest handler', () => {
8686 const handler = await createHonoApp (
8787 createHonoHandler ( {
8888 getClient : ( ) => client ,
89- apiHandler : new RPCApiHandler ( { schema : client . $schema } ) ,
89+ apiHandler : new RestApiHandler ( { endpoint : 'http://localhost/api' , schema : client . $schema } ) ,
9090 } )
9191 ) ;
9292
9393 let r = await handler ( makeRequest ( 'GET' , makeUrl ( '/api/post/1' ) ) ) ;
9494 expect ( r . status ) . toBe ( 404 ) ;
9595
96- r = await handler (
97- makeRequest ( 'POST' , '/api/user' )
98- ) ;
99-
100- r = await handler ( makeRequest ( 'GET' , makeUrl ( '/api/post/1' ) ) ) ;
101- expect ( r . status ) . toBe ( 404 ) ;
102-
10396 r = await handler (
10497 makeRequest ( 'POST' , '/api/user' , {
10598 data : {
0 commit comments