mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 00:11:19 +00:00
fix(test): reject rpc rtt flag values
This commit is contained in:
parent
d3c907193f
commit
b83dce7b33
2 changed files with 5 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ function usage() {
|
|||
|
||||
function readFlagValue(argv, index, flag) {
|
||||
const value = argv[index + 1];
|
||||
if (!value || value.startsWith("--")) {
|
||||
if (!value || value.startsWith("-")) {
|
||||
throw new Error(`${flag} requires a value.`);
|
||||
}
|
||||
return value;
|
||||
|
|
|
|||
|
|
@ -178,8 +178,10 @@ describe("scripts/measure-rpc-rtt.mjs", () => {
|
|||
expect(() => parseArgs(["--output-dir", "/tmp/rpc-rtt", "--methods"])).toThrow(
|
||||
"--methods requires a value.",
|
||||
);
|
||||
for (const flag of ["--output-dir", "--repo-root", "--iterations", "--methods"]) {
|
||||
expect(() => parseArgs([flag, "--methods", "health"])).toThrow(`${flag} requires a value.`);
|
||||
for (const value of ["--methods", "-h"]) {
|
||||
for (const flag of ["--output-dir", "--repo-root", "--iterations", "--methods"]) {
|
||||
expect(() => parseArgs([flag, value, "health"])).toThrow(`${flag} requires a value.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue