@@ -158,7 +158,7 @@ mod tests {
158
158
159
159
let s = String :: from_utf8 ( out) . unwrap ( ) ;
160
160
insta:: with_settings!( { snapshot_suffix => BACKEND } , {
161
- insta:: assert_snapshot!( & s) ;
161
+ insta:: assert_snapshot!( "infer_schema" , & s) ;
162
162
} ) ;
163
163
}
164
164
@@ -320,9 +320,9 @@ mod tests {
320
320
321
321
let query = "{\" query\" : \" { Users { id name } } \" }" ;
322
322
let mutation = r#"{"query":"mutation CreateUser {\n CreateUser(NewUser: {name: \"Max\"}) {\n id\n name\n }\n}","variables":null,"operationName":"CreateUser"}"# ;
323
- let t1 = request_test ( & client, & listen_url, query) ;
324
- let t2 = request_test ( & client, & listen_url, mutation) ;
325
- let t3 = request_test ( & client, & listen_url, query) ;
323
+ let t1 = request_test ( & client, & listen_url, query, "round_trip_test__query_1" ) ;
324
+ let t2 = request_test ( & client, & listen_url, mutation, "round_trip_test__mutation" ) ;
325
+ let t3 = request_test ( & client, & listen_url, query, "round_trip_test__query_2" ) ;
326
326
327
327
child. kill ( ) . unwrap ( ) ;
328
328
child. wait ( ) . unwrap ( ) ;
@@ -336,6 +336,7 @@ mod tests {
336
336
client : & reqwest:: Client ,
337
337
listen_url : & str ,
338
338
body : & ' static str ,
339
+ snapshot_name : & ' static str ,
339
340
) -> Result < ( ) , String > {
340
341
fn error_mapper < T : std:: fmt:: Debug > ( e : T ) -> String {
341
342
format ! ( "{:?}" , e)
@@ -351,7 +352,12 @@ mod tests {
351
352
. send ( )
352
353
. map_err ( error_mapper) ?;
353
354
let r = r. json :: < serde_json:: Value > ( ) . map_err ( error_mapper) ?;
354
- std:: panic:: catch_unwind ( || insta:: assert_json_snapshot!( r) ) . map_err ( error_mapper) ?;
355
+ std:: panic:: catch_unwind ( || {
356
+ insta:: with_settings!( { snapshot_suffix => "" } , {
357
+ insta:: assert_json_snapshot!( snapshot_name, r)
358
+ } )
359
+ } )
360
+ . map_err ( error_mapper) ?;
355
361
Ok ( ( ) )
356
362
}
357
363
}
0 commit comments