@@ -12,7 +12,7 @@ describe('serializeRequestMessage & deserializeRequestMessage', () => {
1212 it ( 'should serialize and deserialize a basic POST request' , ( ) => {
1313 const id = 'req-123'
1414 const payload : RequestMessageMap [ MessageType . REQUEST ] = {
15- url : new URL ( 'orpc ://localhost /api/users' ) ,
15+ url : new URL ( 'http ://orpc /api/users' ) ,
1616 method : 'POST' ,
1717 headers : { 'content-type' : 'application/json' } ,
1818 body : { name : 'John' } ,
@@ -34,7 +34,7 @@ describe('serializeRequestMessage & deserializeRequestMessage', () => {
3434
3535 expect ( decodedId ) . toBe ( id )
3636 expect ( decodedType ) . toBe ( MessageType . REQUEST )
37- expect ( decodedPayload . url . toString ( ) ) . toBe ( 'orpc ://localhost /api/users' )
37+ expect ( decodedPayload . url . toString ( ) ) . toBe ( 'http ://orpc /api/users' )
3838 expect ( decodedPayload . method ) . toBe ( 'POST' )
3939 expect ( decodedPayload . headers ) . toEqual ( { 'content-type' : 'application/json' } )
4040 expect ( decodedPayload . body ) . toEqual ( { name : 'John' } )
@@ -75,7 +75,7 @@ describe('serializeRequestMessage & deserializeRequestMessage', () => {
7575 const blobData = new Blob ( [ 'test content' ] , { type : 'text/plain' } )
7676
7777 const payload : RequestMessageMap [ MessageType . REQUEST ] = {
78- url : new URL ( 'orpc ://localhost /upload' ) ,
78+ url : new URL ( 'http ://orpc /upload' ) ,
7979 method : 'POST' ,
8080 headers : { 'content-type' : 'text/plain' } ,
8181 body : blobData ,
@@ -140,7 +140,7 @@ describe('serializeRequestMessage & deserializeRequestMessage', () => {
140140 it ( 'should omit empty headers and default POST method' , ( ) => {
141141 const id = 'req-minimal'
142142 const payload : RequestMessageMap [ MessageType . REQUEST ] = {
143- url : new URL ( 'orpc ://localhost /test' ) ,
143+ url : new URL ( 'http ://orpc /test' ) ,
144144 method : 'POST' ,
145145 headers : { } ,
146146 body : 'data' ,
@@ -337,12 +337,12 @@ describe('encode/decode request message', () => {
337337 } )
338338
339339 describe . each ( [
340- [ 'GET' , new URL ( 'orpc ://localhost /api/v1/users/1?a=1&b=2' ) , { } ] ,
341- [ 'GET' , new URL ( 'orpc :///localhost /api/v1/users/1?a=1&b=2' ) , { } ] ,
342- [ 'GET' , new URL ( 'orpc ://example.com/api/v1/users/1?a=1&b=2' ) , { } ] ,
343- [ 'GET' , new URL ( 'orpc :///example.com/api/v1/users/1?a=1&b=2' ) , { } ] ,
344- [ 'GET' , new URL ( 'orpc :/api/v1/users/1?a=1&b=2' ) , { } ] ,
345- [ 'GET' , new URL ( 'orpc ://api/v1/users/1?a=1&b=2' ) , { } ] ,
340+ [ 'GET' , new URL ( 'http ://orpc /api/v1/users/1?a=1&b=2' ) , { } ] ,
341+ [ 'GET' , new URL ( 'http :///orpc /api/v1/users/1?a=1&b=2' ) , { } ] ,
342+ [ 'GET' , new URL ( 'http ://example.com/api/v1/users/1?a=1&b=2' ) , { } ] ,
343+ [ 'GET' , new URL ( 'http :///example.com/api/v1/users/1?a=1&b=2' ) , { } ] ,
344+ [ 'GET' , new URL ( 'http :/api/v1/users/1?a=1&b=2' ) , { } ] ,
345+ [ 'GET' , new URL ( 'http ://api/v1/users/1?a=1&b=2' ) , { } ] ,
346346 [ 'GET' , new URL ( 'https://example.com/api/v1/users/1?a=1&b=2' ) , { } ] ,
347347 [ 'POST' , new URL ( 'https://example.com/api/v1/users/1' ) , { 'x-custom-header' : 'value' } ] ,
348348 [ 'DELETE' , new URL ( 'https://example.com/api/v1/users/1' ) , { } ] ,
0 commit comments