@@ -41,7 +41,7 @@ describe('cleanLSPDownloads', function () {
4141
4242 it ( 'keeps two newest versions' , async function ( ) {
4343 await fakeInstallVersions ( [ '1.0.0' , '1.0.1' , '1.1.1' , '2.1.1' ] , installationDir . fsPath )
44- const deleted = await cleanLspDownloads ( [ ] , installationDir . fsPath )
44+ const deleted = await cleanLspDownloads ( '2.1.1' , [ ] , installationDir . fsPath )
4545
4646 const result = ( await fs . readdir ( installationDir . fsPath ) ) . map ( ( [ filename , _filetype ] , _index ) => filename )
4747 assert . strictEqual ( result . length , 2 )
@@ -53,6 +53,7 @@ describe('cleanLSPDownloads', function () {
5353 it ( 'deletes delisted versions' , async function ( ) {
5454 await fakeInstallVersions ( [ '1.0.0' , '1.0.1' , '1.1.1' , '2.1.1' ] , installationDir . fsPath )
5555 const deleted = await cleanLspDownloads (
56+ '2.1.1' ,
5657 [ { serverVersion : '1.1.1' , isDelisted : true , targets : [ ] } ] ,
5758 installationDir . fsPath
5859 )
@@ -67,6 +68,7 @@ describe('cleanLSPDownloads', function () {
6768 it ( 'handles case where less than 2 versions are not delisted' , async function ( ) {
6869 await fakeInstallVersions ( [ '1.0.0' , '1.0.1' , '1.1.1' , '2.1.1' ] , installationDir . fsPath )
6970 const deleted = await cleanLspDownloads (
71+ '' ,
7072 [
7173 { serverVersion : '1.1.1' , isDelisted : true , targets : [ ] } ,
7274 { serverVersion : '2.1.1' , isDelisted : true , targets : [ ] } ,
@@ -83,7 +85,7 @@ describe('cleanLSPDownloads', function () {
8385
8486 it ( 'handles case where less than 2 versions exist' , async function ( ) {
8587 await fakeInstallVersions ( [ '1.0.0' ] , installationDir . fsPath )
86- const deleted = await cleanLspDownloads ( [ ] , installationDir . fsPath )
88+ const deleted = await cleanLspDownloads ( '1.0.0' , [ ] , installationDir . fsPath )
8789
8890 const result = ( await fs . readdir ( installationDir . fsPath ) ) . map ( ( [ filename , _filetype ] , _index ) => filename )
8991 assert . strictEqual ( result . length , 1 )
@@ -93,6 +95,7 @@ describe('cleanLSPDownloads', function () {
9395 it ( 'does not install delisted version when no other option exists' , async function ( ) {
9496 await fakeInstallVersions ( [ '1.0.0' ] , installationDir . fsPath )
9597 const deleted = await cleanLspDownloads (
98+ '1.0.0' ,
9699 [ { serverVersion : '1.0.0' , isDelisted : true , targets : [ ] } ] ,
97100 installationDir . fsPath
98101 )
@@ -105,6 +108,7 @@ describe('cleanLSPDownloads', function () {
105108 it ( 'ignores invalid versions' , async function ( ) {
106109 await fakeInstallVersions ( [ '1.0.0' , '.DS_STORE' ] , installationDir . fsPath )
107110 const deleted = await cleanLspDownloads (
111+ '1.0.0' ,
108112 [ { serverVersion : '1.0.0' , isDelisted : true , targets : [ ] } ] ,
109113 installationDir . fsPath
110114 )
0 commit comments