@websign/sdk - v0.1.0
    Preparing search index...

    Function installFakeWebSign

    • Installs the fake on the current window (replacing an earlier fake) and announces it, as the real extension does when a page loads. Needs a DOM: a browser, or a test environment such as jsdom or happy-dom.

      Parameters

      Returns Promise<FakeWebSign>

      // In a unit test (Vitest/Jest with a DOM environment):
      let fake: FakeWebSign;
      beforeEach(async () => (fake = await installFakeWebSign()));
      afterEach(() => fake.uninstall());
      // In your app, only in development: the import is dropped from production builds.
      if (import.meta.env.DEV) await (await import("@websign/sdk/testing")).installFakeWebSign();

      without a window, or on a non-local origin without allowAnyOrigin.