refactor(extensions): dedupe connector helper usage

This commit is contained in:
Peter Steinberger
2026-02-16 14:51:55 +00:00
parent bc55ffb160
commit 544ffbcf7b
49 changed files with 854 additions and 1478 deletions

View File

@@ -1,4 +1,3 @@
import type { PluginRuntime } from "openclaw/plugin-sdk";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
@@ -6,23 +5,11 @@ import { beforeEach, describe, expect, it } from "vitest";
import type { StoredConversationReference } from "./conversation-store.js";
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
import { setMSTeamsRuntime } from "./runtime.js";
const runtimeStub = {
state: {
resolveStateDir: (env: NodeJS.ProcessEnv = process.env, homedir?: () => string) => {
const override = env.OPENCLAW_STATE_DIR?.trim() || env.OPENCLAW_STATE_DIR?.trim();
if (override) {
return override;
}
const resolvedHome = homedir ? homedir() : os.homedir();
return path.join(resolvedHome, ".openclaw");
},
},
} as unknown as PluginRuntime;
import { msteamsRuntimeStub } from "./test-runtime.js";
describe("msteams conversation store (fs)", () => {
beforeEach(() => {
setMSTeamsRuntime(runtimeStub);
setMSTeamsRuntime(msteamsRuntimeStub);
});
it("filters and prunes expired entries (but keeps legacy ones)", async () => {