mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
perf(test): batch source directory routing assertions
This commit is contained in:
@@ -2629,13 +2629,22 @@ describe("scripts/test-projects changed-target routing", () => {
|
||||
["ui/src", "test/vitest/vitest.ui.config.ts"],
|
||||
] as const;
|
||||
|
||||
const plansByConfig = new Map(
|
||||
buildVitestRunPlans(
|
||||
cases.map(([target]) => target),
|
||||
process.cwd(),
|
||||
).map((plan) => [plan.config, plan]),
|
||||
);
|
||||
for (const [target, config] of cases) {
|
||||
expect(buildVitestRunPlans([target], process.cwd()).at(-1)).toEqual({
|
||||
const plan = plansByConfig.get(config);
|
||||
expect(plan).toMatchObject({
|
||||
config,
|
||||
forwardedArgs: [],
|
||||
includePatterns: [`${target}/**/*.test.ts`],
|
||||
watchMode: false,
|
||||
});
|
||||
expect(plan?.includePatterns?.filter((pattern) => pattern.endsWith("/**/*.test.ts"))).toEqual(
|
||||
[`${target}/**/*.test.ts`],
|
||||
);
|
||||
}
|
||||
|
||||
expect(buildVitestRunPlans(["src/plugin-sdk"], process.cwd())).toEqual([
|
||||
|
||||
Reference in New Issue
Block a user