-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.openclawcode.config.mjs
More file actions
37 lines (35 loc) · 1.1 KB
/
vitest.openclawcode.config.mjs
File metadata and controls
37 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
const repoRoot = path.dirname(fileURLToPath(import.meta.url));
const pluginSdkSubpaths = fs
.readdirSync(path.join(repoRoot, "src", "plugin-sdk"))
.filter((name) => name.endsWith(".ts"))
.filter((name) => !name.endsWith(".test.ts"))
.filter((name) => name !== "index.ts")
.map((name) => name.replace(/\.ts$/, ""));
export default defineConfig({
resolve: {
alias: [
{
find: "openclaw/extension-api",
replacement: path.join(repoRoot, "src", "extensionAPI.ts"),
},
...pluginSdkSubpaths.map((subpath) => ({
find: `openclaw/plugin-sdk/${subpath}`,
replacement: path.join(repoRoot, "src", "plugin-sdk", `${subpath}.ts`),
})),
{
find: "openclaw/plugin-sdk",
replacement: path.join(repoRoot, "src", "plugin-sdk", "index.ts"),
},
],
},
test: {
include: ["src/openclawcode/testing/**/*.test.ts"],
environment: "node",
pool: "threads",
testTimeout: 30000,
},
});