@@ -24,7 +24,7 @@ function createTestInjector() {
2424 testInjector . register ( "prompter" , { } ) ;
2525 testInjector . register ( "platformEnvironmentRequirements" , PlatformEnvironmentRequirements ) ;
2626 testInjector . register ( "staticConfig" , { SYS_REQUIREMENTS_LINK : "" } ) ;
27- testInjector . register ( "nativescriptCloudExtensionService " , { } ) ;
27+ testInjector . register ( "nativeScriptCloudExtensionService " , { } ) ;
2828
2929 return testInjector ;
3030}
@@ -59,10 +59,10 @@ describe("platformEnvironmentRequirements ", () => {
5959 } ;
6060 }
6161
62- function mockNativescriptCloudExtensionService ( data : { isInstalled : boolean } ) {
63- const nativescriptCloudExtensionService = testInjector . resolve ( "nativescriptCloudExtensionService " ) ;
64- nativescriptCloudExtensionService . isInstalled = ( ) => data . isInstalled ;
65- nativescriptCloudExtensionService . install = ( ) => { isExtensionInstallCalled = true ; } ;
62+ function mockNativeScriptCloudExtensionService ( data : { isInstalled : boolean } ) {
63+ const nativeScriptCloudExtensionService = testInjector . resolve ( "nativeScriptCloudExtensionService " ) ;
64+ nativeScriptCloudExtensionService . isInstalled = ( ) => data . isInstalled ;
65+ nativeScriptCloudExtensionService . install = ( ) => { isExtensionInstallCalled = true ; } ;
6666 }
6767
6868 beforeEach ( ( ) => {
@@ -87,7 +87,7 @@ describe("platformEnvironmentRequirements ", () => {
8787 it ( "should show prompt when environment is not configured and nativescript-cloud extension is not installed" , async ( ) => {
8888 mockDoctorService ( { canExecuteLocalBuild : false } ) ;
8989 mockPrompter ( { firstCallOptionName : PlatformEnvironmentRequirements . CLOUD_SETUP_OPTION_NAME } ) ;
90- mockNativescriptCloudExtensionService ( { isInstalled : false } ) ;
90+ mockNativeScriptCloudExtensionService ( { isInstalled : false } ) ;
9191
9292 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) ) ;
9393 assert . isTrue ( promptForChoiceData . length === 1 ) ;
@@ -98,7 +98,7 @@ describe("platformEnvironmentRequirements ", () => {
9898 it ( "should show prompt when environment is not configured and nativescript-cloud extension is installed" , async ( ) => {
9999 mockDoctorService ( { canExecuteLocalBuild : false } ) ;
100100 mockPrompter ( { firstCallOptionName : PlatformEnvironmentRequirements . CLOUD_SETUP_OPTION_NAME } ) ;
101- mockNativescriptCloudExtensionService ( { isInstalled : true } ) ;
101+ mockNativeScriptCloudExtensionService ( { isInstalled : true } ) ;
102102
103103 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) ) ;
104104 assert . isTrue ( promptForChoiceData . length === 1 ) ;
@@ -123,7 +123,7 @@ describe("platformEnvironmentRequirements ", () => {
123123 doctorService . canExecuteLocalBuild = ( ) => false ;
124124 doctorService . runSetupScript = async ( ) => { doctorService . canExecuteLocalBuild = ( ) => true ; } ;
125125
126- mockNativescriptCloudExtensionService ( { isInstalled : null } ) ;
126+ mockNativeScriptCloudExtensionService ( { isInstalled : null } ) ;
127127
128128 assert . isTrue ( await platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) ) ;
129129 } ) ;
@@ -132,14 +132,14 @@ describe("platformEnvironmentRequirements ", () => {
132132 it ( "should setup manually when cloud extension is installed" , async ( ) => {
133133 mockDoctorService ( { canExecuteLocalBuild : false , mockSetupScript : true } ) ;
134134 mockPrompter ( { firstCallOptionName : PlatformEnvironmentRequirements . LOCAL_SETUP_OPTION_NAME , secondCallOptionName : PlatformEnvironmentRequirements . MANUALLY_SETUP_OPTION_NAME } ) ;
135- mockNativescriptCloudExtensionService ( { isInstalled : true } ) ;
135+ mockNativeScriptCloudExtensionService ( { isInstalled : true } ) ;
136136
137137 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) , manuallySetupErrorMessage ) ;
138138 } ) ;
139139 describe ( "and cloud extension is not installed" , ( ) => {
140140 beforeEach ( ( ) => {
141141 mockDoctorService ( { canExecuteLocalBuild : false , mockSetupScript : true } ) ;
142- mockNativescriptCloudExtensionService ( { isInstalled : false } ) ;
142+ mockNativeScriptCloudExtensionService ( { isInstalled : false } ) ;
143143 } ) ;
144144 it ( "should list 2 posibile options to select" , async ( ) => {
145145 mockPrompter ( { firstCallOptionName : PlatformEnvironmentRequirements . LOCAL_SETUP_OPTION_NAME } ) ;
@@ -168,7 +168,7 @@ describe("platformEnvironmentRequirements ", () => {
168168 } ) ;
169169
170170 it ( "should install nativescript-cloud extension when it is not installed" , async ( ) => {
171- mockNativescriptCloudExtensionService ( { isInstalled : false } ) ;
171+ mockNativeScriptCloudExtensionService ( { isInstalled : false } ) ;
172172 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) , cloudBuildsErrorMessage ) ;
173173 assert . isTrue ( isExtensionInstallCalled ) ;
174174 } ) ;
@@ -181,11 +181,11 @@ describe("platformEnvironmentRequirements ", () => {
181181 } ) ;
182182
183183 it ( "should fail when nativescript-cloud extension is installed" , async ( ) => {
184- mockNativescriptCloudExtensionService ( { isInstalled : true } ) ;
184+ mockNativeScriptCloudExtensionService ( { isInstalled : true } ) ;
185185 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) , manuallySetupErrorMessage ) ;
186186 } ) ;
187187 it ( "should fail when nativescript-cloud extension is not installed" , async ( ) => {
188- mockNativescriptCloudExtensionService ( { isInstalled : false } ) ;
188+ mockNativeScriptCloudExtensionService ( { isInstalled : false } ) ;
189189 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) , manuallySetupErrorMessage ) ;
190190 } ) ;
191191 } ) ;
@@ -198,11 +198,11 @@ describe("platformEnvironmentRequirements ", () => {
198198 } ) ;
199199
200200 it ( "should fail when nativescript-cloud extension is installed" , async ( ) => {
201- mockNativescriptCloudExtensionService ( { isInstalled : true } ) ;
201+ mockNativeScriptCloudExtensionService ( { isInstalled : true } ) ;
202202 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) , nonInteractiveConsoleMessageWhenExtensionIsInstalled ) ;
203203 } ) ;
204204 it ( "should fail when nativescript-cloud extension is not installed" , async ( ) => {
205- mockNativescriptCloudExtensionService ( { isInstalled : false } ) ;
205+ mockNativeScriptCloudExtensionService ( { isInstalled : false } ) ;
206206 await assert . isRejected ( platformEnvironmentRequirements . checkEnvironmentRequirements ( platform ) , nonInteractiveConsoleMessageWhenExtensionIsNotInstalled ) ;
207207 } ) ;
208208 } ) ;
0 commit comments