@@ -445,32 +445,6 @@ pub fn project_layout_for_test_file(
445445 Arc :: new ( project_layout)
446446}
447447
448- #[ cfg( test) ]
449- mod tests {
450- use super :: * ;
451- use biome_fs:: MemoryFileSystem ;
452-
453- #[ test]
454- fn finds_catalog_from_workspace_file ( ) {
455- let fs = MemoryFileSystem :: default ( ) ;
456- fs. insert (
457- Utf8Path :: new ( "project/src/pnpm-workspace.yaml" ) . into ( ) ,
458- b"catalog:\n react: 19.0.0\n " . to_vec ( ) ,
459- ) ;
460-
461- let catalog = find_pnpm_workspace_catalog ( & fs, Utf8Path :: new ( "project/src/input.js" ) )
462- . expect ( "catalog should be parsed" ) ;
463- let default = catalog. default . expect ( "default catalog present" ) ;
464- assert_eq ! ( default . get( "react" ) , Some ( "19.0.0" ) ) ;
465- }
466-
467- #[ test]
468- fn no_catalog_when_workspace_missing ( ) {
469- let fs = MemoryFileSystem :: default ( ) ;
470- assert ! ( find_pnpm_workspace_catalog( & fs, Utf8Path :: new( "project/src/input.js" ) ) . is_none( ) ) ;
471- }
472- }
473-
474448pub fn diagnostic_to_string ( name : & str , source : & str , diag : Error ) -> String {
475449 let error = diag. with_file_path ( name) . with_file_source_code ( source) ;
476450 markup_to_string ( biome_console:: markup! {
@@ -818,3 +792,29 @@ pub fn assert_diagnostics_expectation_comment<L: Language>(
818792 }
819793 }
820794}
795+
796+ #[ cfg( test) ]
797+ mod tests {
798+ use super :: * ;
799+ use biome_fs:: MemoryFileSystem ;
800+
801+ #[ test]
802+ fn finds_catalog_from_workspace_file ( ) {
803+ let fs = MemoryFileSystem :: default ( ) ;
804+ fs. insert (
805+ Utf8Path :: new ( "project/src/pnpm-workspace.yaml" ) . into ( ) ,
806+ b"catalog:\n react: 19.0.0\n " . to_vec ( ) ,
807+ ) ;
808+
809+ let catalog = find_pnpm_workspace_catalog ( & fs, Utf8Path :: new ( "project/src/input.js" ) )
810+ . expect ( "catalog should be parsed" ) ;
811+ let default = catalog. default . expect ( "default catalog present" ) ;
812+ assert_eq ! ( default . get( "react" ) , Some ( "19.0.0" ) ) ;
813+ }
814+
815+ #[ test]
816+ fn no_catalog_when_workspace_missing ( ) {
817+ let fs = MemoryFileSystem :: default ( ) ;
818+ assert ! ( find_pnpm_workspace_catalog( & fs, Utf8Path :: new( "project/src/input.js" ) ) . is_none( ) ) ;
819+ }
820+ }
0 commit comments