fix web tests

This commit is contained in:
Marin Petrunic 2022-04-15 11:51:06 +02:00
parent 7c2e883527
commit 35bf7684d7
3 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,7 @@ module.exports = function (config) {
frameworks: [
"webpack",
"mocha",
//"chai",
"chai",
],
files: [
"test/unit-web/run-web-implementation.test.ts",

View File

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

View File

@ -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