mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
v3.8.40 cycle integration → main. All test gates green (Unit/Integration/Coverage/Node-compat/Quality-Ratchet). The only red check, 'PR Test Policy', is the test-masking heuristic firing on the cumulative ~57-commit release diff (legitimate assert consolidations already reviewed per-PR — Gemini CLI removal #5246, retired GPT models #5280, provider catalog refreshes); overridden with --admin per the documented release-PR convention. CodeQL/SonarQube advisory scans non-blocking; #5278's code already passed CodeQL on main. Homologated on VPS 192.168.0.15 (v3.8.40 healthy).
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { processRtkText } from "../../../open-sse/services/compression/engines/rtk/index.ts";
|
|
import { applyRenderer } from "../../../open-sse/services/compression/engines/rtk/renderers/index.ts"; // sanity import
|
|
|
|
// keep unused import check quiet
|
|
void applyRenderer;
|
|
|
|
const GIT_DIFF = `diff --git a/x.ts b/x.ts
|
|
index 111..222 100644
|
|
--- a/x.ts
|
|
+++ b/x.ts
|
|
@@ -1,3 +1,3 @@
|
|
-const a = 1;
|
|
+const a = 2;
|
|
const b = 3;`;
|
|
|
|
test("enableRenderers default false ⇒ baseline unchanged", () => {
|
|
const off = processRtkText(GIT_DIFF, { command: "git diff", config: { enabled: true } });
|
|
const explicitOff = processRtkText(GIT_DIFF, {
|
|
command: "git diff",
|
|
config: { enabled: true, enableRenderers: false },
|
|
});
|
|
assert.equal(off.text, explicitOff.text); // renderer não roda por default
|
|
});
|
|
|
|
test("enableRenderers true ⇒ git diff is rendered through processRtkText", () => {
|
|
const on = processRtkText(GIT_DIFF, {
|
|
command: "git diff",
|
|
config: { enabled: true, enableRenderers: true },
|
|
});
|
|
assert.ok(on.techniquesUsed.includes("rtk-render:git-diff"));
|
|
assert.ok(!on.text.includes("index ")); // contexto/metadata dropado
|
|
});
|
|
|
|
test("fail-open: renderer error keeps prior result", () => {
|
|
// entrada que detecta git-diff mas é benigna; renderer não deve lançar nem alterar incorretamente
|
|
const r = processRtkText("not really a diff", {
|
|
command: "git diff",
|
|
config: { enabled: true, enableRenderers: true },
|
|
});
|
|
assert.ok(typeof r.text === "string"); // nunca lança
|
|
});
|