Files
openclaw/src/plugin-sdk/api-baseline.test.ts
Peter Steinberger 4f4d108639 chore(lint): remove underscore-dangle allow list (#83542)
* chore(lint): reduce underscore-dangle exceptions

* chore(lint): reduce more underscore exceptions

* chore(lint): remove underscore-dangle allow list

* fix(lint): repair underscore cleanup regressions

* test(lint): track version define suppression
2026-05-18 14:56:06 +01:00

19 lines
887 B
TypeScript

import path from "node:path";
import { describe, expect, it } from "vitest";
import { normalizePluginSdkApiDeclarationText } from "./api-baseline.js";
describe("Plugin SDK API baseline", () => {
it("normalizes declaration import paths to repo-relative paths", () => {
const repoRoot = process.cwd();
const modelCatalogPath = path.join(repoRoot, "src", "agents", "pi-model-discovery-runtime");
const declaration = `export function setModelCatalogImportForTest(loader?: (() => Promise<typeof import("${modelCatalogPath}", { with: { "resolution-mode": "import" } })>) | undefined): void;`;
const normalized = normalizePluginSdkApiDeclarationText(repoRoot, declaration);
expect(normalized).not.toContain(repoRoot);
expect(normalized).toContain(
'import("src/agents/pi-model-discovery-runtime", { with: { "resolution-mode": "import" } })',
);
});
});