mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 23:20:41 +00:00
test: simplify ci changed scope output parsing
This commit is contained in:
@@ -45,16 +45,15 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
function parseGitHubOutput(output: string): Record<string, string> {
|
||||
return Object.fromEntries(
|
||||
output
|
||||
.trim()
|
||||
.split("\n")
|
||||
.filter(Boolean)
|
||||
.map((line) => {
|
||||
const separator = line.indexOf("=");
|
||||
return [line.slice(0, separator), line.slice(separator + 1)];
|
||||
}),
|
||||
);
|
||||
const parsed: Record<string, string> = {};
|
||||
for (const line of output.trim().split("\n")) {
|
||||
if (!line) {
|
||||
continue;
|
||||
}
|
||||
const separator = line.indexOf("=");
|
||||
parsed[line.slice(0, separator)] = line.slice(separator + 1);
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
||||
describe("detectChangedScope", () => {
|
||||
|
||||
Reference in New Issue
Block a user