Skip to content
Snippets Groups Projects
Commit f8d5bd09 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

IWorkerBeeGlobals extended by wax instance to make possible referencing wax...

IWorkerBeeGlobals extended by wax instance to make possible referencing wax types (like ReplyOperation etc)
parent 1a4fcd43
No related branches found
No related tags found
1 merge request!30Added dedicated test for WorkerBee.broadcast method
// We only want to import types here!
import type beekeeperFactoryType from "@hiveio/beekeeper/web";
import type Wax from "@hiveio/wax";
import type WorkerBee from "../../dist/bundle/index";
export type TEnvType = "web" | "node";
......@@ -8,6 +10,7 @@ export type TEnvType = "web" | "node";
export interface IWorkerBeeGlobals {
beekeeperFactory: typeof beekeeperFactoryType;
WorkerBee: typeof WorkerBee;
wax: typeof Wax;
}
declare global {
......
......@@ -2,15 +2,18 @@
globalThis.createTestFor = async function createTestFor(env) {
const locWorkerBee = env === "web" ? "../../dist/bundle/index.js" : "../../dist/bundle/index.js";
const locBeekeeper = env === "web" ? "@hiveio/beekeeper/web" : "@hiveio/beekeeper/node";
const locWax = env === "web" ? "@hiveio/wax/web" : "@hiveio/wax/node";
// Import required libraries env-dependent
const wb = await import(locWorkerBee);
const beekeeper = await import(locBeekeeper);
const wax = await import(locWax);
// Provide results
return {
beekeeperFactory: beekeeper.default,
WorkerBee: wb.default
WorkerBee: wb.default,
wax
};
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment