feat(Adb): list devices _and_ emulators in one go (#1125)

This commit is contained in:
Raphael von der Grün
2020-11-19 21:30:56 +01:00
committed by GitHub
parent 0e8234abfd
commit aa679ea1d6
6 changed files with 42 additions and 70 deletions
+4 -4
View File
@@ -205,13 +205,13 @@ describe('emulator', () => {
});
describe('list_started', () => {
it('should call adb devices with the emulators flag', () => {
it('should return a list of all online emulators', () => {
const AdbSpy = jasmine.createSpyObj('Adb', ['devices']);
AdbSpy.devices.and.returnValue(Promise.resolve());
AdbSpy.devices.and.resolveTo(['emulator-5556', '123a76565509e124']);
emu.__set__('Adb', AdbSpy);
return emu.list_started().then(() => {
expect(AdbSpy.devices).toHaveBeenCalledWith({ emulators: true });
return emu.list_started().then(emus => {
expect(emus).toEqual(['emulator-5556']);
});
});
});