Files
radicle-explorer/tests/support/cobs/issue.ts
T
Rūdolfs Ošiņš 293f6adb52 Fix e2e test suite compatibility with heartwood 1.7.1
- Trim trailing newline from heartwood-release file read to prevent
  invalid binary paths
- Replace repeated --label flags with a single --labels flag (new CLI)
- Add --accept verdict to rad patch review calls that lacked one (now
  required by the CLI)
2026-03-23 10:59:25 -06:00

27 lines
661 B
TypeScript

import type { RadiclePeer } from "@tests/support/peerManager.js";
import type { Options } from "execa";
export async function create(
peer: RadiclePeer,
title: string,
description: string,
labels: string[],
options: Options,
): Promise<string> {
const issueOptions: string[] = [
"issue",
"open",
"--title",
title,
"--description",
description,
...(labels.length > 0 ? ["--labels", labels.join(",")] : []),
];
const { stdout } = await peer.rad(issueOptions, options);
const match = stdout.match(/Issue {3}([a-zA-Z0-9]*)/);
if (!match) {
throw new Error("Not able to parse issue id");
}
return match[1];
}