@@ -48,38 +48,24 @@ describe('OutputChannelLogger tests', () => {
4848 } ) ;
4949
5050 it ( 'should create a side log in the workspace area' , async ( ) => {
51- await sideLogTest ( 'storagePath' , 'globalStoragePath' ) ;
52- } ) ;
53-
54- it ( 'should create a side log in the global area' , async ( ) => {
55- await sideLogTest ( 'globalStoragePath' , 'storagePath' ) ;
56- } ) ;
57-
58- async function sideLogTest ( expectedArea : string , otherArea : string ) : Promise < void > {
59- logger . init ( {
60- [ expectedArea ] : tempFolders [ expectedArea ] . name ,
61- [ otherArea ] : undefined
62- } ) ;
51+ logger . init ( tempFolders . storagePath . name ) ;
6352
6453 await logger . log ( 'xxx' , { additionalLogLocation : 'first' } ) ;
6554 await logger . log ( 'yyy' , { additionalLogLocation : 'second' } ) ;
6655 await logger . log ( 'zzz' , { additionalLogLocation : 'first' , trailingNewline : false } ) ;
6756 await logger . log ( 'aaa' ) ;
6857
6958 // expect 2 side logs
70- const testLoggerFolder = path . join ( tempFolders [ expectedArea ] . name , 'test-logger' ) ;
59+ const testLoggerFolder = path . join ( tempFolders . storagePath . name , 'test-logger' ) ;
7160 expect ( fs . readdirSync ( testLoggerFolder ) . length ) . to . equal ( 2 ) ;
72- expect ( fs . readdirSync ( tempFolders [ otherArea ] . name ) . length ) . to . equal ( 0 ) ;
7361
7462 // contents
7563 expect ( fs . readFileSync ( path . join ( testLoggerFolder , 'first' ) , 'utf8' ) ) . to . equal ( 'xxx\nzzz' ) ;
7664 expect ( fs . readFileSync ( path . join ( testLoggerFolder , 'second' ) , 'utf8' ) ) . to . equal ( 'yyy\n' ) ;
77- }
65+ } ) ;
7866
7967 it ( 'should delete side logs on dispose' , async ( ) => {
80- logger . init ( {
81- storagePath : tempFolders . storagePath . name
82- } ) ;
68+ logger . init ( tempFolders . storagePath . name ) ;
8369 await logger . log ( 'xxx' , { additionalLogLocation : 'first' } ) ;
8470 await logger . log ( 'yyy' , { additionalLogLocation : 'second' } ) ;
8571
@@ -94,9 +80,7 @@ describe('OutputChannelLogger tests', () => {
9480 } ) ;
9581
9682 it ( 'should remove an additional log location' , async ( ) => {
97- logger . init ( {
98- storagePath : tempFolders . storagePath . name
99- } ) ;
83+ logger . init ( tempFolders . storagePath . name ) ;
10084 await logger . log ( 'xxx' , { additionalLogLocation : 'first' } ) ;
10185 await logger . log ( 'yyy' , { additionalLogLocation : 'second' } ) ;
10286
@@ -112,9 +96,7 @@ describe('OutputChannelLogger tests', () => {
11296
11397 it ( 'should delete an existing folder on init' , async ( ) => {
11498 fs . createFileSync ( path . join ( tempFolders . storagePath . name , 'test-logger' , 'xxx' ) ) ;
115- logger . init ( {
116- storagePath : tempFolders . storagePath . name
117- } ) ;
99+ logger . init ( tempFolders . storagePath . name ) ;
118100 // should be empty dir
119101
120102 const testLoggerFolder = path . join ( tempFolders . storagePath . name , 'test-logger' ) ;
0 commit comments