73 lines
1.6 KiB
TypeScript
73 lines
1.6 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const pluginSdkDir = path.resolve(__dirname, "extensions/mattermost/src/plugin-sdk");
|
|
|
|
const pluginSdkModules = [
|
|
"error-runtime",
|
|
"retry-runtime",
|
|
"config-runtime",
|
|
"reply-runtime",
|
|
"ssrf-runtime",
|
|
"zod",
|
|
"account-helpers",
|
|
"account-id",
|
|
"account-resolution",
|
|
"secret-input",
|
|
"conversation-runtime",
|
|
"core",
|
|
"setup",
|
|
"approval-auth-runtime",
|
|
"channel-policy",
|
|
];
|
|
|
|
const aliases: Record<string, string> = {
|
|
"openclaw/plugin-sdk": path.join(pluginSdkDir, "index.ts"),
|
|
};
|
|
|
|
for (const mod of pluginSdkModules) {
|
|
aliases[`openclaw/plugin-sdk/${mod}`] = path.join(pluginSdkDir, `${mod}.ts`);
|
|
}
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
include: [
|
|
"extensions/mattermost/src/**/*.{test,spec}.{ts,js}",
|
|
"tests/**/*.{test,spec}.{ts,js}",
|
|
],
|
|
exclude: [
|
|
"node_modules/**",
|
|
"tests/integration/**",
|
|
"tests/e2e/**",
|
|
"**/*.config.{ts,js}",
|
|
"**/*.d.ts",
|
|
],
|
|
deps: {
|
|
inline: ["openclaw/plugin-sdk", /openclaw\/plugin-sdk/],
|
|
},
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "json", "html"],
|
|
thresholds: {
|
|
lines: 80,
|
|
functions: 80,
|
|
branches: 80,
|
|
statements: 80,
|
|
},
|
|
exclude: [
|
|
"node_modules/**",
|
|
"tests/**",
|
|
"**/*.config.{ts,js}",
|
|
"**/*.d.ts",
|
|
],
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: aliases,
|
|
},
|
|
});
|