44 */
55
66import { Uri } from 'vscode'
7- import { cleanUpLSPDownloads , fs } from '../../../shared'
7+ import { cleanLspDownloads , fs } from '../../../shared'
88import { createTestWorkspaceFolder } from '../../testUtil'
99import path from 'path'
1010import assert from 'assert'
@@ -21,7 +21,7 @@ async function fakeInstallVersions(versions: string[], installationDir: string):
2121 }
2222}
2323
24- describe ( 'cleanUpLSPDownloads ' , function ( ) {
24+ describe ( 'cleanLSPDownloads ' , function ( ) {
2525 let installationDir : Uri
2626
2727 before ( async function ( ) {
@@ -41,7 +41,7 @@ describe('cleanUpLSPDownloads', 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- await cleanUpLSPDownloads ( [ ] , installationDir . fsPath )
44+ await cleanLspDownloads ( [ ] , installationDir . fsPath )
4545
4646 const result = ( await fs . readdir ( installationDir . fsPath ) ) . map ( ( [ filename , _filetype ] , _index ) => filename )
4747 assert . strictEqual ( result . length , 2 )
@@ -51,7 +51,7 @@ describe('cleanUpLSPDownloads', function () {
5151
5252 it ( 'deletes delisted versions' , async function ( ) {
5353 await fakeInstallVersions ( [ '1.0.0' , '1.0.1' , '1.1.1' , '2.1.1' ] , installationDir . fsPath )
54- await cleanUpLSPDownloads ( [ { serverVersion : '1.1.1' , isDelisted : true , targets : [ ] } ] , installationDir . fsPath )
54+ await cleanLspDownloads ( [ { serverVersion : '1.1.1' , isDelisted : true , targets : [ ] } ] , installationDir . fsPath )
5555
5656 const result = ( await fs . readdir ( installationDir . fsPath ) ) . map ( ( [ filename , _filetype ] , _index ) => filename )
5757 assert . strictEqual ( result . length , 2 )
@@ -61,7 +61,7 @@ describe('cleanUpLSPDownloads', function () {
6161
6262 it ( 'handles case where less than 2 versions are not delisted' , async function ( ) {
6363 await fakeInstallVersions ( [ '1.0.0' , '1.0.1' , '1.1.1' , '2.1.1' ] , installationDir . fsPath )
64- await cleanUpLSPDownloads (
64+ await cleanLspDownloads (
6565 [
6666 { serverVersion : '1.1.1' , isDelisted : true , targets : [ ] } ,
6767 { serverVersion : '2.1.1' , isDelisted : true , targets : [ ] } ,
@@ -77,15 +77,15 @@ describe('cleanUpLSPDownloads', function () {
7777
7878 it ( 'handles case where less than 2 versions exist' , async function ( ) {
7979 await fakeInstallVersions ( [ '1.0.0' ] , installationDir . fsPath )
80- await cleanUpLSPDownloads ( [ ] , installationDir . fsPath )
80+ await cleanLspDownloads ( [ ] , installationDir . fsPath )
8181
8282 const result = ( await fs . readdir ( installationDir . fsPath ) ) . map ( ( [ filename , _filetype ] , _index ) => filename )
8383 assert . strictEqual ( result . length , 1 )
8484 } )
8585
8686 it ( 'does not install delisted version when no other option exists' , async function ( ) {
8787 await fakeInstallVersions ( [ '1.0.0' ] , installationDir . fsPath )
88- await cleanUpLSPDownloads ( [ { serverVersion : '1.0.0' , isDelisted : true , targets : [ ] } ] , installationDir . fsPath )
88+ await cleanLspDownloads ( [ { serverVersion : '1.0.0' , isDelisted : true , targets : [ ] } ] , installationDir . fsPath )
8989
9090 const result = ( await fs . readdir ( installationDir . fsPath ) ) . map ( ( [ filename , _filetype ] , _index ) => filename )
9191 assert . strictEqual ( result . length , 0 )
0 commit comments