fix: publish LCOV in Sonar CI so PR quality gate passes
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 1m35s
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 1m35s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-1
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user