diff --git a/spec/afterStart.test.ts b/spec/afterStart.test.ts index 40c8d34..f733635 100644 --- a/spec/afterStart.test.ts +++ b/spec/afterStart.test.ts @@ -29,10 +29,11 @@ afterAll(async () => { describe("after start a emulator", () => { test("list packages", async () => { - console.log("emulatorId", emulatorId); if (emulatorId) { const list = await android.listPackages(emulatorId); expect(list.length).toBeGreaterThan(0); + } else { + expect(1).toBe(0); } }); @@ -40,6 +41,8 @@ describe("after start a emulator", () => { if (emulatorId) { const res = await android.isInstalled(emulatorId, "com.android.webview"); expect(res).toBe(true); + } else { + expect(1).toBe(0); } }); @@ -49,6 +52,8 @@ describe("after start a emulator", () => { const res = await android.install(emulatorId, apk); expect(res).toBeUndefined(); await android.adb(emulatorId, `uninstall com.appmaker.pwa2apk.pwa.androidapp`); + } else { + expect(1).toBe(0); } }, 60000); @@ -57,6 +62,8 @@ describe("after start a emulator", () => { await expect(async () => { await android.install(emulatorId, "123123.apk"); }).rejects.toThrow(); + } else { + expect(1).toBe(0); } }, 30000); diff --git a/src/util.ts b/src/util.ts index bdefd04..57f6477 100644 --- a/src/util.ts +++ b/src/util.ts @@ -24,6 +24,7 @@ export function spawnExec(command: string, timeout = 60000) { output: string; }; const clock = setTimeout(() => { + console.log("timeout", timeout, command); reject(Error("Execution timeout")); }, timeout); let output = "";