mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 00:11:19 +00:00
perf(test): batch source directory routing assertions
This commit is contained in:
parent
325cdb7f1a
commit
db42f05efe
1 changed files with 11 additions and 2 deletions
|
|
@ -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([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue