mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-18 12:11:37 +00:00
feat(tooling): enforce indexed access checks in root tests (#105223)
* feat(tooling): enforce indexed access checks in root tests * style(tooling): clarify scoped package guard
This commit is contained in:
committed by
GitHub
parent
251f54baec
commit
e0f45bfbf0
@@ -58,7 +58,9 @@ function expectDeclaredDispatchInputs(command: string): void {
|
||||
on?: { workflow_dispatch?: { inputs?: Record<string, unknown> } };
|
||||
};
|
||||
const declared = new Set(Object.keys(workflow.on?.workflow_dispatch?.inputs ?? {}));
|
||||
const emitted = [...command.matchAll(/(?:^|\s)-f\s+([a-z0-9_]+)=/gu)].map((match) => match[1]);
|
||||
const emitted = [...command.matchAll(/(?:^|\s)-f\s+([a-z0-9_]+)=/gu)].flatMap((match) =>
|
||||
match[1] === undefined ? [] : [match[1]],
|
||||
);
|
||||
expect(emitted.length).toBeGreaterThan(0);
|
||||
for (const input of emitted) {
|
||||
expect(declared.has(input), `undeclared workflow_dispatch input: ${input}`).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user