Initial Commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from "@suaveplan/testing/runner";
|
||||
|
||||
describe("dep-graph", () => {
|
||||
it("package has correct name", { timeout: 5000 }, async () => {
|
||||
const pkg = await import("../package.json", { with: { type: "json" } });
|
||||
expect(pkg.default.name).toBe("@suaveplan/events-otel");
|
||||
});
|
||||
|
||||
it("exports attachEventTracing", { timeout: 30000 }, async () => {
|
||||
const { attachEventTracing } = await import("../src/index.js");
|
||||
expect(typeof attachEventTracing).toBe("function");
|
||||
});
|
||||
|
||||
it("exports serializeTraceContext", { timeout: 30000 }, async () => {
|
||||
const { serializeTraceContext } = await import("../src/index.js");
|
||||
expect(typeof serializeTraceContext).toBe("function");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
import { webcrypto } from "node:crypto";
|
||||
|
||||
// Polyfill Web Crypto for Node.js environments (Vitest forks pool)
|
||||
if (typeof globalThis.crypto === "undefined") {
|
||||
Object.defineProperty(globalThis, "crypto", {
|
||||
value: webcrypto,
|
||||
writable: false,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user