Skip to content

Commit

Permalink
chore: tes &ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wtto00 committed Sep 17, 2023
1 parent 21ba546 commit 51b1d45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/afterStart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@ 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);
}
});

test("isInstalled package", async () => {
if (emulatorId) {
const res = await android.isInstalled(emulatorId, "com.android.webview");
expect(res).toBe(true);
} else {
expect(1).toBe(0);
}
});

Expand All @@ -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);

Expand All @@ -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);

Expand Down
1 change: 1 addition & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down

0 comments on commit 51b1d45

Please sign in to comment.