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
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||||
const webpackConfig = require("./webpack.config");
|
const webpackConfig = require("./webpack.config");
|
||||||
|
|
||||||
module.exports = function(config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
|
basePath: "",
|
||||||
|
frameworks: ["mocha", "chai"],
|
||||||
|
files: ["test/unit/*.ts"],
|
||||||
|
exclude: [],
|
||||||
|
preprocessors: {
|
||||||
|
"test/unit/run-web-implementation.test.ts": ["webpack"],
|
||||||
|
},
|
||||||
|
webpack: {
|
||||||
|
mode: "production",
|
||||||
|
node: webpackConfig.node,
|
||||||
|
module: webpackConfig.module,
|
||||||
|
resolve: webpackConfig.resolve,
|
||||||
|
},
|
||||||
|
reporters: ["spec"],
|
||||||
|
|
||||||
basePath: "",
|
browsers: ["ChromeHeadless"],
|
||||||
frameworks: ["mocha", "chai"],
|
|
||||||
files: ["test/unit/*.ts"],
|
|
||||||
exclude: [],
|
|
||||||
preprocessors: {
|
|
||||||
"test/**/*.ts": ["webpack"]
|
|
||||||
},
|
|
||||||
webpack: {
|
|
||||||
mode: "production",
|
|
||||||
node: webpackConfig.node,
|
|
||||||
module: webpackConfig.module,
|
|
||||||
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 {runIndexTests} from "./index.test";
|
||||||
import {forEachImplementation} from "../switch";
|
import {forEachImplementation} from "../switch";
|
||||||
|
|
||||||
|
// Import test's bls lib lazily to prevent breaking test with Karma
|
||||||
forEachImplementation(["blst", "herumi"], (bls) => {
|
forEachImplementation(["blst", "herumi"], (bls) => {
|
||||||
runPrivateKeyTests(bls);
|
runPrivateKeyTests(bls);
|
||||||
runPublicKeyTests(bls);
|
runPublicKeyTests(bls);
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
|
import herumi from "../../src/herumi";
|
||||||
import {runPrivateKeyTests} from "./privateKey.test";
|
import {runPrivateKeyTests} from "./privateKey.test";
|
||||||
import {runPublicKeyTests} from "./publicKey.test";
|
import {runPublicKeyTests} from "./publicKey.test";
|
||||||
// import {runKeypairTests} from "./keypair.test";
|
// import {runKeypairTests} from "./keypair.test";
|
||||||
import {runIndexTests} from "./index.test";
|
import {runIndexTests} from "./index.test";
|
||||||
import {forEachImplementation} from "../switch";
|
|
||||||
|
|
||||||
forEachImplementation(["herumi"], (bls) => {
|
// This file is intended to be compiled and run by Karma
|
||||||
runPrivateKeyTests(bls);
|
// Do not import the node.bindings or it will break with:
|
||||||
runPublicKeyTests(bls);
|
// 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);
|
// runKeypairTests(bls);
|
||||||
runIndexTests(bls);
|
runIndexTests(herumi);
|
||||||
});
|
});
|
||||||
|
|
Reference in New Issue