Whenever CLI returns information for available emulators/simulators, the returned object for each of the image has a status property.
For Android the status is "Running" or "Not running", for iOS it is "Connected" or "Disconnected".
Unify the status properties - use "Running" and "Not running" for both of the images.
Also, for iOS images, the imageIdentifier property has not been populated - fill it with the value of the identifier property, so the API will be consistent for both Android and iOS.
As the property has not been populated for iOS Simulators, the events "emulatorImageFound" and "emulatorImageLost" were never triggered in case you add new iOS Simulator images. Now this should work correctly.
Fix unit tests on Windows - the split by EOL when parsing the output of avdmanager executable is not working on Windows, as the EOL is \r\n, while the avdmanager prints results with \n only.
Also the tests were failing on Windows due to the same reason - test case has \n, while split is by \r\n.
Use some constants in the tests instead of strings for status property.
Whenever CLI returns information for available emulators/simulators, the returned object for each of the image has a status property. For Android the status is "Running" or "Not running", for iOS it is "Connected" or "Disconnected". Unify the status properties - use "Running" and "Not running" for both of the images.
Also, for iOS images, the imageIdentifier property has not been populated - fill it with the value of the identifier property, so the API will be consistent for both Android and iOS. As the property has not been populated for iOS Simulators, the events "emulatorImageFound" and "emulatorImageLost" were never triggered in case you add new iOS Simulator images. Now this should work correctly.
Fix unit tests on Windows - the split by EOL when parsing the output of avdmanager executable is not working on Windows, as the EOL is
\r\n
, while the avdmanager prints results with\n
only. Also the tests were failing on Windows due to the same reason - test case has\n
, while split is by\r\n
.Use some constants in the tests instead of strings for status property.