Files
OmniRoute/tests/unit/build/check-tracked-artifacts.test.ts
Diego Rodrigues de Sa e Souza 81a37b67ed Release v3.8.26 (#3875)
OmniRoute v3.8.26 — see CHANGELOG.md [3.8.26] for the full notes.

Highlights: Vertex AI media generation (#3929), GLM-5.2 effort-tier routing (#3885),
sticky round-robin combos (#3846), OpenRouter connection presets (#3878), compression
prompt-cache fix (#3936/#3890), and a security pass (form-data/vite + workflow hardening, #3949).

Co-authored-by: artickc <artickc@users.noreply.github.com>
Co-authored-by: rdself <rdself@users.noreply.github.com>
Co-authored-by: herjarsa <herjarsa@users.noreply.github.com>
Co-authored-by: Jack Smith <16862258+YunyunZhai@users.noreply.github.com>
Co-authored-by: dhaern <dhaern@users.noreply.github.com>
Co-authored-by: adivekar-utexas <adivekar-utexas@users.noreply.github.com>
Co-authored-by: megamen32 <megamen32@users.noreply.github.com>
Co-authored-by: zhiru <zhiru@users.noreply.github.com>
Co-authored-by: insoln <insoln@users.noreply.github.com>
Co-authored-by: diego-anselmo <diego-anselmo@users.noreply.github.com>
2026-06-16 01:00:40 -03:00

63 lines
2.1 KiB
TypeScript

// tests/unit/build/check-tracked-artifacts.test.ts
// TDD test for check-tracked-artifacts.mjs gate.
import test from "node:test";
import assert from "node:assert/strict";
import { checkTrackedArtifacts } from "../../../scripts/check/check-tracked-artifacts.mjs";
test("checkTrackedArtifacts: empty list passes", () => {
const result = checkTrackedArtifacts([]);
assert.deepEqual(result, []);
});
test("checkTrackedArtifacts: node_modules/ prefix is flagged", () => {
const result = checkTrackedArtifacts(["node_modules/some-pkg/index.js"]);
assert.equal(result.length, 1);
assert.ok(result[0].includes("node_modules/some-pkg/index.js"));
});
test("checkTrackedArtifacts: .next/ prefix is flagged", () => {
const result = checkTrackedArtifacts([".next/static/chunks/main.js"]);
assert.equal(result.length, 1);
});
test("checkTrackedArtifacts: coverage/ prefix is flagged", () => {
const result = checkTrackedArtifacts(["coverage/lcov.info"]);
assert.equal(result.length, 1);
});
test("checkTrackedArtifacts: quality-metrics.json is flagged", () => {
const result = checkTrackedArtifacts(["quality-metrics.json"]);
assert.equal(result.length, 1);
});
test("checkTrackedArtifacts: config/quality/quality-metrics.json is flagged", () => {
const result = checkTrackedArtifacts(["config/quality/quality-metrics.json"]);
assert.equal(result.length, 1);
});
test("checkTrackedArtifacts: symlink mode (120000) is flagged", () => {
const result = checkTrackedArtifacts([], ["node_modules"]);
assert.equal(result.length, 1);
assert.ok(result[0].includes("node_modules"));
});
test("checkTrackedArtifacts: normal source files pass", () => {
const result = checkTrackedArtifacts([
"src/app/page.tsx",
"open-sse/handlers/chat.ts",
"package.json",
"tests/unit/some.test.ts",
]);
assert.deepEqual(result, []);
});
test("checkTrackedArtifacts: multiple violations reported", () => {
const result = checkTrackedArtifacts([
"src/ok.ts",
"node_modules/.bin/jscpd",
".next/server/app/page.js",
"coverage/lcov.info",
]);
assert.equal(result.length, 3);
});