@@ -9,7 +9,6 @@ import * as chai from 'chai';
99import * as util from '../../../src/common' ;
1010import { CreateTmpDir , TmpAsset } from '../../../src/CreateTmpAsset' ;
1111import TestZip from '../testAssets/TestZip' ;
12- import { IPackage } from '../../../src/packageManager/Package' ;
1312import { DownloadAndInstallPackages } from '../../../src/packageManager/PackageManager' ;
1413import NetworkSettings from '../../../src/NetworkSettings' ;
1514import { PlatformInformation } from '../../../src/platform' ;
@@ -18,6 +17,7 @@ import { DownloadStart, DownloadSizeObtained, DownloadProgress, DownloadSuccess,
1817import MockHttpsServer from '../testAssets/MockHttpsServer' ;
1918import { createTestFile } from '../testAssets/TestFile' ;
2019import TestEventBus from '../testAssets/TestEventBus' ;
20+ import { Package } from '../../../src/packageManager/Package' ;
2121
2222chai . use ( require ( "chai-as-promised" ) ) ;
2323const expect = chai . expect ;
@@ -26,10 +26,10 @@ suite("Package Manager", () => {
2626 let tmpInstallDir : TmpAsset ;
2727 let server : MockHttpsServer ;
2828 let testZip : TestZip ;
29- let installationPath : string ;
29+ let extensionPath : string ;
3030 let eventStream : EventStream ;
3131 let eventBus : TestEventBus ;
32- let packages : IPackage [ ] ;
32+ let packages : Package [ ] ;
3333
3434 const packageDescription = "Test Package" ;
3535
@@ -42,12 +42,12 @@ suite("Package Manager", () => {
4242 server = await MockHttpsServer . CreateMockHttpsServer ( ) ;
4343 eventBus = new TestEventBus ( eventStream ) ;
4444 tmpInstallDir = await CreateTmpDir ( true ) ;
45- installationPath = tmpInstallDir . name ;
46- packages = < IPackage [ ] > [
45+ extensionPath = tmpInstallDir . name ;
46+ packages = < Package [ ] > [
4747 {
4848 url : `${ server . baseUrl } /package` ,
4949 description : packageDescription ,
50- installPath : installationPath ,
50+ installPath : "installPath" ,
5151 platforms : [ windowsPlatformInfo . platform ] ,
5252 architectures : [ windowsPlatformInfo . architecture ]
5353 } ] ;
@@ -61,9 +61,9 @@ suite("Package Manager", () => {
6161 } ) ;
6262
6363 test ( "Downloads the package and installs at the specified path" , async ( ) => {
64- await DownloadAndInstallPackages ( packages , networkSettingsProvider , windowsPlatformInfo , eventStream ) ;
64+ await DownloadAndInstallPackages ( packages , networkSettingsProvider , windowsPlatformInfo , eventStream , extensionPath ) ;
6565 for ( let elem of testZip . files ) {
66- let filePath = path . join ( installationPath , elem . path ) ;
66+ let filePath = path . join ( extensionPath , "installPath" , elem . path ) ;
6767 expect ( await util . fileExists ( filePath ) ) . to . be . true ;
6868 }
6969 } ) ;
@@ -77,13 +77,13 @@ suite("Package Manager", () => {
7777 new InstallationStart ( packageDescription )
7878 ] ;
7979
80- await DownloadAndInstallPackages ( packages , networkSettingsProvider , windowsPlatformInfo , eventStream ) ;
80+ await DownloadAndInstallPackages ( packages , networkSettingsProvider , windowsPlatformInfo , eventStream , extensionPath ) ;
8181 expect ( eventBus . getEvents ( ) ) . to . be . deep . equal ( eventsSequence ) ;
8282 } ) ;
8383
8484 test ( "Installs only the platform specific packages" , async ( ) => {
8585 //since there is no linux package specified no package should be installed
86- await DownloadAndInstallPackages ( packages , networkSettingsProvider , linuxPlatformInfo , eventStream ) ;
86+ await DownloadAndInstallPackages ( packages , networkSettingsProvider , linuxPlatformInfo , eventStream , extensionPath ) ;
8787 let files = await fs . readdir ( tmpInstallDir . name ) ;
8888 expect ( files . length ) . to . equal ( 0 ) ;
8989 } ) ;
0 commit comments