kubeagent 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/telemetry.test.d.ts +1 -0
- package/dist/telemetry.test.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
const TELEMETRY_DIR = join(homedir(), ".kubeagent");
|
|
5
|
+
const SENT_FILE = join(TELEMETRY_DIR, ".telemetry-sent");
|
|
6
|
+
describe("sendTelemetry", () => {
|
|
7
|
+
it("module exports sendTelemetry function", async () => {
|
|
8
|
+
const mod = await import("./telemetry.js");
|
|
9
|
+
expect(typeof mod.sendTelemetry).toBe("function");
|
|
10
|
+
});
|
|
11
|
+
it("does not throw when called", async () => {
|
|
12
|
+
// If marker file already exists from a real run, this just returns early.
|
|
13
|
+
// If not, it fires a fetch that will fail silently (no server).
|
|
14
|
+
// Either way it should not throw.
|
|
15
|
+
const { sendTelemetry } = await import("./telemetry.js");
|
|
16
|
+
expect(() => sendTelemetry("0.0.0-test")).not.toThrow();
|
|
17
|
+
});
|
|
18
|
+
});
|