Run only web implementation in Karma
This commit is contained in:
parent
4424bed87d
commit
70ccbfbe5b
|
@ -1,26 +1,25 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const webpackConfig = require("./webpack.config");
|
||||
|
||||
module.exports = function(config) {
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
|
||||
basePath: "",
|
||||
frameworks: ["mocha", "chai"],
|
||||
files: ["test/unit/*.ts"],
|
||||
exclude: [],
|
||||
preprocessors: {
|
||||
"test/**/*.ts": ["webpack"]
|
||||
"test/unit/run-web-implementation.test.ts": ["webpack"],
|
||||
},
|
||||
webpack: {
|
||||
mode: "production",
|
||||
node: webpackConfig.node,
|
||||
module: webpackConfig.module,
|
||||
resolve: webpackConfig.resolve
|
||||
resolve: webpackConfig.resolve,
|
||||
},
|
||||
reporters: ["spec"],
|
||||
|
||||
browsers: ["ChromeHeadless"],
|
||||
|
||||
singleRun: true
|
||||
singleRun: true,
|
||||
});
|
||||
};
|
|
@ -4,6 +4,7 @@ import {runPublicKeyTests} from "./publicKey.test";
|
|||
import {runIndexTests} from "./index.test";
|
||||
import {forEachImplementation} from "../switch";
|
||||
|
||||
// Import test's bls lib lazily to prevent breaking test with Karma
|
||||
forEachImplementation(["blst", "herumi"], (bls) => {
|
||||
runPrivateKeyTests(bls);
|
||||
runPublicKeyTests(bls);
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
import herumi from "../../src/herumi";
|
||||
import {runPrivateKeyTests} from "./privateKey.test";
|
||||
import {runPublicKeyTests} from "./publicKey.test";
|
||||
// import {runKeypairTests} from "./keypair.test";
|
||||
import {runIndexTests} from "./index.test";
|
||||
import {forEachImplementation} from "../switch";
|
||||
|
||||
forEachImplementation(["herumi"], (bls) => {
|
||||
runPrivateKeyTests(bls);
|
||||
runPublicKeyTests(bls);
|
||||
// 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", () => {
|
||||
before(async () => {
|
||||
await herumi.initBLS();
|
||||
});
|
||||
|
||||
runPrivateKeyTests(herumi);
|
||||
runPublicKeyTests(herumi);
|
||||
// runKeypairTests(bls);
|
||||
runIndexTests(bls);
|
||||
runIndexTests(herumi);
|
||||
});
|
||||
|
|
Reference in New Issue