mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:00:44 +00:00
Bound native hook permission fingerprints (#71758)
* fix: bound native hook permission fingerprints * fix: address native hook fingerprint review * test: isolate native jiti runtime assertions
This commit is contained in:
@@ -17,6 +17,24 @@ let resolvePluginSetupProvider: typeof import("./setup-registry.js").resolvePlug
|
||||
let resolvePluginSetupCliBackend: typeof import("./setup-registry.js").resolvePluginSetupCliBackend;
|
||||
let runPluginSetupConfigMigrations: typeof import("./setup-registry.js").runPluginSetupConfigMigrations;
|
||||
|
||||
function forceNodeRuntimeVersionsForTest(): () => void {
|
||||
const originalVersions = process.versions;
|
||||
const nodeVersions = { ...originalVersions } as NodeJS.ProcessVersions & {
|
||||
bun?: string | undefined;
|
||||
};
|
||||
delete nodeVersions.bun;
|
||||
Object.defineProperty(process, "versions", {
|
||||
configurable: true,
|
||||
value: nodeVersions,
|
||||
});
|
||||
return () => {
|
||||
Object.defineProperty(process, "versions", {
|
||||
configurable: true,
|
||||
value: originalVersions,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function makeTempDir(): string {
|
||||
return makeTrackedTempDir("openclaw-setup-registry", tempDirs);
|
||||
}
|
||||
@@ -166,6 +184,7 @@ describe("setup-registry getJiti", () => {
|
||||
diagnostics: [],
|
||||
});
|
||||
const platformSpy = vi.spyOn(process, "platform", "get").mockReturnValue("win32");
|
||||
const restoreVersions = forceNodeRuntimeVersionsForTest();
|
||||
|
||||
try {
|
||||
resolvePluginSetupRegistry({
|
||||
@@ -173,6 +192,7 @@ describe("setup-registry getJiti", () => {
|
||||
env: {},
|
||||
});
|
||||
} finally {
|
||||
restoreVersions();
|
||||
platformSpy.mockRestore();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user