mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 13:23:08 +00:00
* 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
19 lines
887 B
TypeScript
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" } })',
|
|
);
|
|
});
|
|
});
|