File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
wundergraph_cli/src/print_schema Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -328,8 +328,22 @@ mod tests {
328328 client : & reqwest:: Client ,
329329 listen_url : & str ,
330330 body : & ' static str ,
331- ) -> Result < ( ) , std:: string:: String > {
332- let r = client
331+ ) -> Result < ( ) , String > {
332+ fn error_mapper < T : std:: fmt:: Debug > ( e : T ) -> String {
333+ format ! ( "{:?}" , e)
334+ }
335+
336+ let r = client
337+ . post ( & format ! ( "http://{}/graphql" , listen_url) ) )
338+ . body ( body)
339+ . header (
340+ reqwest:: header:: CONTENT_TYPE ,
341+ reqwest:: header:: HeaderValue :: from_static ( "application/json" ) ,
342+ ) . send ( ) . map_err ( error_mapper) ?;
343+ let mut r = r. json :: < serde_json:: Value > ( ) . map_err ( error_mapper) ?;
344+ std:: panic:: catch_unwind ( || insta:: assert_json_snapshot!( r) ) . map_err ( error_mapper) ?;
345+ Ok ( ( ) )
346+ }
333347 . post ( & format ! ( "http://{}/graphql" , listen_url) )
334348 . body ( body)
335349 . header (
You can’t perform that action at this time.
0 commit comments