Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  loader-sdk-import-guardrails.test.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";

const ALLOWED_PLUGIN_SDK_FIXTURE_IMPORTS = new Set([
  // Intentional legacy SDK-root compatibility smoke tests.
  'src/plugins/loader.test.ts:configSchema: (require("openclaw/plugin-sdk").emptyPluginConfigSchema)(),',
  'src/plugins/loader.test.ts:const { onDiagnosticEvent } = require("openclaw/plugin-sdk");',
  // Intentional jiti alias regression test.
  'src/plugins/loader.git-path-regression.test.ts:`import { resolveOutboundSendDep } from "openclaw/plugin-sdk/infra-runtime";',
  'src/plugins/loader.git-path-regression.test.ts:          "openclaw/plugin-sdk/infra-runtime": ${JSON.stringify(copiedChannelRuntimeShim)},',
  // Intentional packaged bundled-plugin SDK alias regression tests.
  'src/plugins/loader.test.ts:`import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";`,',
]);

const LOADER_FIXTURE_TEST_FILES = [
  "src/plugins/loader.cli-metadata.test.ts",
  "src/plugins/loader.git-path-regression.test.ts",
  "src/plugins/loader.test.ts",
];

function findLoaderFixtureSdkImports(): string[] {
  const repoRoot = process.cwd();
  const matches: string[] = [];
  for (const file of LOADER_FIXTURE_TEST_FILES) {
    const source = fs.readFileSync(path.join(repoRoot, file), "utf-8");
    for (const line of source.split("\n")) {
      if (
        line.includes('require("openclaw/plugin-sdk') ||
        (line.includes("import ") && line.includes('"openclaw/plugin-sdk'))
      ) {
        matches.push(`${file}:${line.trim()}`);
      }
    }
  }
  return matches;
}

describe("plugin loader fixture SDK imports", () => {
  it("keeps generated jiti plugin fixtures off the SDK except explicit compatibility smokes", () => {
    const unexpected = findLoaderFixtureSdkImports().filter(
      (entry) => !ALLOWED_PLUGIN_SDK_FIXTURE_IMPORTS.has(entry),
    );

    expect(unexpected).toEqual([]);
  });
});

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge