Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix: snap install faster, run all tests (#163)
Browse files Browse the repository at this point in the history
* fix: run all tests, faster check for installed snap

* fix condition bug
  • Loading branch information
mpetrunic authored Oct 26, 2022
1 parent 564aa4b commit d1a3ec4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/snap/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function installSnap(
await installPage.goto("https://google.com");
const installAction = installPage.evaluate(
(opts: { snapId: string; version?: string }) =>
window.ethereum.request({
window.ethereum.request<{ snaps: { [snapId: string]: {} } }>({
method: "wallet_enable",
params: [
{
Expand Down Expand Up @@ -57,14 +57,14 @@ export async function installSnap(
await clickOnButton(page, "Install");
}

await installAction;
await installPage.close({ runBeforeUnload: true });

for (const step of opts.customSteps ?? []) {
await step(page);
}
if (!(await isSnapInstalled(page, snapId))) {
throw new Error("Failed to install snap " + snapId);

const result = await installAction;
await installPage.close({ runBeforeUnload: true });
if (!(snapId in result.snaps)) {
throw new Error("Failed to install snap");
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/flask/snaps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TestContext } from "../constant";
import { Snaps } from "../deploy";
import { toUrl } from "../utils/utils";

describe.only("snaps", function () {
describe("snaps", function () {
let metamask: dappeteer.Dappeteer;

before(function (this: TestContext) {
Expand Down

0 comments on commit d1a3ec4

Please sign in to comment.