refactor: expose SDK test helper subpaths

This commit is contained in:
Peter Steinberger
2026-04-28 03:27:56 +01:00
parent 21528222c3
commit e1acb61317
156 changed files with 791 additions and 242 deletions

View File

@@ -7,7 +7,7 @@ const availabilityState = vi.hoisted(() => ({
}));
vi.mock("node:fs", async () => {
const { mockNodeBuiltinModule } = await import("../../../test/helpers/node-builtin-mocks.js");
const { mockNodeBuiltinModule } = await import("openclaw/plugin-sdk/test-node-mocks");
return mockNodeBuiltinModule(
() => vi.importActual<typeof import("node:fs")>("node:fs"),
{

View File

@@ -1,8 +1,8 @@
import fs from "node:fs";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { withTempHome } from "openclaw/plugin-sdk/test-env";
import { afterEach, describe, expect, it, vi } from "vitest";
import { withTempHome } from "../../../test/helpers/temp-home.js";
const legacyCryptoInspectorAvailability = vi.hoisted(() => ({
available: true,

View File

@@ -1,8 +1,8 @@
import fs from "node:fs";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { withTempHome } from "openclaw/plugin-sdk/test-env";
import { describe, expect, it } from "vitest";
import { withTempHome } from "../../../test/helpers/temp-home.js";
import { autoMigrateLegacyMatrixState, detectLegacyMatrixState } from "./legacy-state.js";
function writeFile(filePath: string, value: string) {

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { withTempHome } from "openclaw/plugin-sdk/test-env";
import { describe, expect, it, vi } from "vitest";
import { withTempHome } from "../../../../../test/helpers/temp-home.js";
import { resolveMatrixAccountStorageRoot } from "../../storage-paths.js";
import type { MatrixRoomKeyBackupRestoreResult } from "../sdk.js";
import { maybeRestoreLegacyMatrixBackup } from "./legacy-crypto-restore.js";

View File

@@ -1,7 +1,7 @@
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { withTempHome } from "openclaw/plugin-sdk/test-env";
import { describe, expect, it } from "vitest";
import { withTempHome } from "../../../test/helpers/temp-home.js";
import { resolveMatrixMigrationAccountTarget } from "./migration-config.js";
import {
MATRIX_OPS_ACCESS_TOKEN,

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { withTempHome } from "openclaw/plugin-sdk/test-env";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { withTempHome } from "../../../test/helpers/temp-home.js";
const legacyCryptoInspectorAvailability = vi.hoisted(() => ({
available: true,

View File

@@ -1,7 +1,7 @@
import fs from "node:fs/promises";
import path from "node:path";
import { withTempHome } from "openclaw/plugin-sdk/test-env";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { withTempHome } from "../../../test/helpers/temp-home.js";
const legacyCryptoInspectorAvailability = vi.hoisted(() => ({
available: true,