@@ -45,18 +45,18 @@ const androidToolsInfo: NativeScriptDoctor.IAndroidToolsInfo = {
4545return "adb" ;
4646} ,
4747getPathToEmulatorExecutable : ( ) => {
48- return "" ;
48+ return "emulator " ;
4949} ,
5050getToolsInfo : ( ) => {
5151return Object . create ( null ) ;
5252} ,
53- validateAndroidHomeEnvVariable : ( ) => {
53+ validateAndroidHomeEnvVariable : ( ) : any [ ] => {
5454return [ ] ;
5555} ,
56- validateInfo : ( ) => {
56+ validateInfo : ( ) : any [ ] => {
5757return [ ] ;
5858} ,
59- validateJavacVersion : ( ) => {
59+ validateJavacVersion : ( ) : any [ ] => {
6060return [ ] ;
6161}
6262} ;
@@ -78,7 +78,8 @@ function createChildProcessResults(childProcessResult: IChildProcessResults): ID
7878"mono --version" : childProcessResult . monoVersion ,
7979"git --version" : childProcessResult . gitVersion ,
8080"gradle -v" : childProcessResult . gradleVersion ,
81- "tns --version" : childProcessResult . nativeScriptCliVersion
81+ "tns --version" : childProcessResult . nativeScriptCliVersion ,
82+ "emulator" : { shouldThrowError : false }
8283} ;
8384}
8485
@@ -110,7 +111,6 @@ function mockSysInfo(childProcessResult: IChildProcessResults, hostInfoOptions?:
110111exec : async ( command : string ) => {
111112return getResultFromChildProcess ( childProcessResultDictionary [ command ] , command ) ;
112113} ,
113-
114114spawnFromEvent : async ( command : string , args : string [ ] , event : string ) => {
115115return getResultFromChildProcess ( childProcessResultDictionary [ command ] , command ) ;
116116} ,
@@ -239,6 +239,10 @@ describe("SysInfo unit tests", () => {
239239assert . deepEqual ( result . nativeScriptCliVersion , childProcessResult . nativeScriptCliVersion . result . stdout ) ;
240240} ;
241241
242+ beforeEach ( ( ) => {
243+ androidToolsInfo . validateAndroidHomeEnvVariable = ( ) : any [ ] => [ ] ;
244+ } ) ;
245+
242246it ( "on Windows" , async ( ) => {
243247sysInfo = mockSysInfo ( childProcessResult , { isWindows : true , isDarwin : false , dotNetVersion : "4.5.1" } ) ;
244248let result = await sysInfo . getSysInfo ( ) ;
@@ -312,6 +316,7 @@ describe("SysInfo unit tests", () => {
312316pod : { shouldThrowError : true } ,
313317nativeScriptCliVersion : { shouldThrowError : true }
314318} ;
319+ androidToolsInfo . validateAndroidHomeEnvVariable = ( ) : any [ ] => [ 1 ] ;
315320} ) ;
316321
317322describe ( "when all of calls throw" , ( ) => {
@@ -330,19 +335,19 @@ describe("SysInfo unit tests", () => {
330335assert . deepEqual ( result . cocoaPodsVer , null ) ;
331336} ;
332337
333- it ( "on Windows" , ( ) => {
338+ it ( "on Windows" , async ( ) => {
334339sysInfo = mockSysInfo ( childProcessResult , { isWindows : true , isDarwin : false , dotNetVersion : "4.5.1" } ) ;
335- assertAllValuesAreNull ( ) ;
340+ await assertAllValuesAreNull ( ) ;
336341} ) ;
337342
338- it ( "on Mac" , ( ) => {
343+ it ( "on Mac" , async ( ) => {
339344sysInfo = mockSysInfo ( childProcessResult , { isWindows : false , isDarwin : true , dotNetVersion : "4.5.1" } ) ;
340- assertAllValuesAreNull ( ) ;
345+ await assertAllValuesAreNull ( ) ;
341346} ) ;
342347
343- it ( "on Linux" , ( ) => {
348+ it ( "on Linux" , async ( ) => {
344349sysInfo = mockSysInfo ( childProcessResult , { isWindows : false , isDarwin : false , dotNetVersion : "4.5.1" } ) ;
345- assertAllValuesAreNull ( ) ;
350+ await assertAllValuesAreNull ( ) ;
346351} ) ;
347352} ) ;
348353} ) ;
0 commit comments