mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 09:20:22 +00:00
perf: route targeted tests to scoped vitest configs
This commit is contained in:
@@ -2,7 +2,10 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createAgentsVitestConfig } from "../vitest.agents.config.ts";
|
||||
import { createAutoReplyVitestConfig } from "../vitest.auto-reply.config.ts";
|
||||
import { createChannelsVitestConfig } from "../vitest.channels.config.ts";
|
||||
import { createCommandsVitestConfig } from "../vitest.commands.config.ts";
|
||||
import { createExtensionsVitestConfig } from "../vitest.extensions.config.ts";
|
||||
import { createGatewayVitestConfig } from "../vitest.gateway.config.ts";
|
||||
import { createScopedVitestConfig, resolveVitestIsolation } from "../vitest.scoped-config.ts";
|
||||
@@ -64,6 +67,9 @@ describe("scoped vitest configs", () => {
|
||||
const defaultChannelsConfig = createChannelsVitestConfig({});
|
||||
const defaultExtensionsConfig = createExtensionsVitestConfig({});
|
||||
const defaultGatewayConfig = createGatewayVitestConfig({});
|
||||
const defaultCommandsConfig = createCommandsVitestConfig({});
|
||||
const defaultAutoReplyConfig = createAutoReplyVitestConfig({});
|
||||
const defaultAgentsConfig = createAgentsVitestConfig({});
|
||||
|
||||
it("defaults channel tests to non-isolated mode", () => {
|
||||
expect(defaultChannelsConfig.test?.isolate).toBe(false);
|
||||
@@ -128,4 +134,19 @@ describe("scoped vitest configs", () => {
|
||||
expect(defaultGatewayConfig.test?.dir).toBe("src/gateway");
|
||||
expect(defaultGatewayConfig.test?.include).toEqual(["**/*.test.ts"]);
|
||||
});
|
||||
|
||||
it("normalizes commands include patterns relative to the scoped dir", () => {
|
||||
expect(defaultCommandsConfig.test?.dir).toBe("src/commands");
|
||||
expect(defaultCommandsConfig.test?.include).toEqual(["**/*.test.ts"]);
|
||||
});
|
||||
|
||||
it("normalizes auto-reply include patterns relative to the scoped dir", () => {
|
||||
expect(defaultAutoReplyConfig.test?.dir).toBe("src/auto-reply");
|
||||
expect(defaultAutoReplyConfig.test?.include).toEqual(["**/*.test.ts"]);
|
||||
});
|
||||
|
||||
it("normalizes agents include patterns relative to the scoped dir", () => {
|
||||
expect(defaultAgentsConfig.test?.dir).toBe("src/agents");
|
||||
expect(defaultAgentsConfig.test?.include).toEqual(["**/*.test.ts"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user