diff --git a/karma.conf.cjs b/karma.conf.cjs index 2df3336..9510986 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -7,7 +7,7 @@ module.exports = function (config) { frameworks: [ "webpack", "mocha", - //"chai", + "chai", ], files: [ "test/unit-web/run-web-implementation.test.ts", diff --git a/test/unit-web/run-web-implementation.test.ts b/test/unit-web/run-web-implementation.test.ts index 343bcd6..1ef09f8 100644 --- a/test/unit-web/run-web-implementation.test.ts +++ b/test/unit-web/run-web-implementation.test.ts @@ -1,4 +1,3 @@ -import herumi from "../../src/herumi/index.js"; import {runSecretKeyTests} from "../unit/secretKey.test.js"; import {runPublicKeyTests} from "../unit/publicKey.test.js"; import {runIndexTests} from "../unit/index.test.js"; @@ -6,7 +5,8 @@ import {runIndexTests} from "../unit/index.test.js"; // This file is intended to be compiled and run by Karma // Do not import the node.bindings or it will break with: // Error: BLST bindings loader should only run in a NodeJS context: process.platform -describe("herumi", () => { +describe("herumi", async () => { + const herumi = (await import("../../src/herumi/index.js")).default; runSecretKeyTests(herumi); runPublicKeyTests(herumi); runIndexTests(herumi); diff --git a/test/unit/index-named-exports.test.ts b/test/unit/index-named-exports.test.ts index de54de6..2d14dca 100644 --- a/test/unit/index-named-exports.test.ts +++ b/test/unit/index-named-exports.test.ts @@ -1,8 +1,13 @@ import {expect} from "chai"; -import bls from "../../src/index.js"; -import type {SecretKey, PublicKey, Signature} from "../../src/types.js"; +import type {SecretKey, PublicKey, Signature, IBls} from "../../src/types.js"; + +describe("types named exports", async () => { + let bls: IBls; + + before(async () => { + bls = (await import("../../src/index.js")).default; + }); -describe("types named exports", () => { it("Classes and methods should be defined", async () => { /** * Sample helper to test argument typing