Skip to content

Commit

Permalink
test: fix failing browsers bundle tests (#6886)
Browse files Browse the repository at this point in the history
* Fix browser failing tests

* Phrasing

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
  • Loading branch information
nazarhussain and nflaig authored Jun 14, 2024
1 parent d101913 commit f29a6db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/light-client/test/unit/webEsmBundle.browser.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call */
import {expect, describe, it, vi} from "vitest";
import {expect, describe, it, vi, beforeAll} from "vitest";
import {sleep} from "@lodestar/utils";
import {Lightclient, LightclientEvent, utils, transport} from "../../dist/lightclient.min.mjs";

describe("web bundle for lightclient", () => {
vi.setConfig({testTimeout: 20_000});

// Sometimes bundle takes some time to load in the browser
beforeAll(async () => {
await sleep(2000);
});

it("should have a global interface", () => {
expect((window as any)["lodestar"]["lightclient"]).toBeDefined();
});
Expand Down

0 comments on commit f29a6db

Please sign in to comment.