@@ -94,6 +94,29 @@ describe("loadConfig", () => {
9494 }
9595 } ) ;
9696
97+ test ( "threads local settings diagnostics on unconfigured early return" , async ( ) => {
98+ const cwd = await emptyCwd ( ) ;
99+ try {
100+ await mkdir ( join ( cwd , ".corbits" ) , { recursive : true } ) ;
101+ await writeFile (
102+ join ( cwd , ".corbits" , "settings.json" ) ,
103+ JSON . stringify ( { unknownKey : true , anotherJunk : 1 } ) ,
104+ ) ;
105+ const result = await loadConfig ( [ "--cwd" , cwd , "do it" ] , {
106+ globalSettingsPath : NO_SETTINGS ,
107+ allowUnconfigured : true ,
108+ } ) ;
109+ expect ( result . configured ) . toBe ( false ) ;
110+ if ( result . configured === false ) {
111+ expect ( result . settingsDiagnostics ) . toBeDefined ( ) ;
112+ expect ( result . settingsDiagnostics ! . length ) . toBeGreaterThan ( 0 ) ;
113+ expect ( result . settingsDiagnostics ! . some ( ( d ) => / u n k n o w n / i. test ( d . message ) ) ) . toBe ( true ) ;
114+ }
115+ } finally {
116+ await rm ( cwd , { recursive : true , force : true } ) ;
117+ }
118+ } ) ;
119+
97120 test ( "UnconfiguredConfig.globalSettingsPath reflects --config path, not the global default" , async ( ) => {
98121 const cwd = await emptyCwd ( ) ;
99122 try {
0 commit comments