fix: publish LCOV in Sonar CI so PR quality gate passes
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 1m35s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-11 15:03:49 -03:00
co-authored by Cursor
parent 3b5c3fb86f
commit 9ef746aa4f
7 changed files with 84 additions and 2 deletions
+17 -1
View File
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { greet } from "./hello.js";
import { greet, main } from "./hello.js";
describe("greet", () => {
it("returns the default greeting", () => {
@@ -11,3 +11,19 @@ describe("greet", () => {
assert.equal(greet("World"), "Hello, World!");
});
});
it("main emits telemetry and logs greeting", async () => {
process.env.OTEL_EXPORTER_OTLP_ENDPOINT =
process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? "http://127.0.0.1:4318";
const logs: unknown[] = [];
const original = console.log;
console.log = (...args: unknown[]) => {
logs.push(args);
};
try {
await main();
assert.deepEqual(logs, [["Hello, TicketLab MCP!"]]);
} finally {
console.log = original;
}
});