mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 20:21:13 +00:00
test(plugins): share async temp helpers in marketplace tests
This commit is contained in:
@@ -4,6 +4,10 @@ import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolvePluginInstallDir } from "./install.js";
|
||||
import {
|
||||
cleanupTrackedTempDirsAsync,
|
||||
makeTrackedTempDirAsync,
|
||||
} from "./test-helpers/fs-fixtures.js";
|
||||
import {
|
||||
removePluginFromConfig,
|
||||
resolveUninstallChannelConfigKeys,
|
||||
@@ -597,13 +601,14 @@ describe("removePluginFromConfig", () => {
|
||||
|
||||
describe("uninstallPlugin", () => {
|
||||
let tempDir: string;
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
beforeEach(async () => {
|
||||
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "uninstall-test-"));
|
||||
tempDir = await makeTrackedTempDirAsync("uninstall-test", tempDirs);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await fs.rm(tempDir, { recursive: true, force: true });
|
||||
await cleanupTrackedTempDirsAsync(tempDirs);
|
||||
});
|
||||
|
||||
it("returns error when plugin not found", async () => {
|
||||
|
||||
Reference in New Issue
Block a user