@@ -308,9 +308,18 @@ describe("Tests for creating and accessing configuration values", () => {
308308 getMessageFromCatalog ( SHARED_MESSAGE_CATALOG , 'ConfigValueMustBeOfType' , 'preserve_all_working_folders' , 'boolean' , 'string' ) ) ;
309309 } )
310310
311- it ( "When supplied root_working_folder is a valid absolute path, then we use it" , ( ) => {
311+ it . each ( [
312+ {
313+ case : 'absolute' ,
314+ testPath : path . join ( TEST_DATA_DIR , 'sampleWorkspace' )
315+ } ,
316+ {
317+ case : 'relative' ,
318+ testPath : path . join ( 'test' , 'test-data' , 'sampleWorkspace' )
319+ }
320+ ] ) ( "When supplied root_working_folder is a valid $case path, then we use it" , ( { testPath} ) => {
312321 const workingFoldersRootValue : string = path . join ( TEST_DATA_DIR , 'sampleWorkspace' ) ;
313- const conf : CodeAnalyzerConfig = CodeAnalyzerConfig . fromObject ( { root_working_folder : workingFoldersRootValue } ) ;
322+ const conf : CodeAnalyzerConfig = CodeAnalyzerConfig . fromObject ( { root_working_folder : testPath } ) ;
314323 expect ( conf . getRootWorkingFolder ( ) ) . toEqual ( workingFoldersRootValue ) ;
315324 } ) ;
316325
@@ -324,11 +333,6 @@ describe("Tests for creating and accessing configuration values", () => {
324333 getMessageFromCatalog ( SHARED_MESSAGE_CATALOG , 'ConfigFolderValueMustNotBeFile' , 'root_working_folder' , path . resolve ( 'package.json' ) ) ) ;
325334 } ) ;
326335
327- it ( "When supplied root_working_folder is a relative folder, then we error" , ( ) => {
328- expect ( ( ) => CodeAnalyzerConfig . fromObject ( { root_working_folder : 'test/test-data' } ) ) . toThrow (
329- getMessage ( 'ConfigPathValueMustBeAbsolute' , 'root_working_folder' , 'test/test-data' , path . resolve ( 'test' , 'test-data' ) ) ) ;
330- } ) ;
331-
332336 it ( "When supplied config_root path is a valid absolute path, then we use it" , ( ) => {
333337 const configRootValue : string = path . join ( TEST_DATA_DIR , 'sampleWorkspace' ) ;
334338 const conf : CodeAnalyzerConfig = CodeAnalyzerConfig . fromObject ( { config_root : configRootValue } ) ;
0 commit comments