Support gh pr checkout pull request references (#1457)
This commit is contained in:
1 parent
02989fe600
commit
d8a485ea7e
8 files changed
+324
-17
No files matched your search
@@ -17,6 +17,20 @@ describe("parsePullRequestReference", () => {
|
||||
expect(parsePullRequestReference("#42")).toBe("#42");
|
||||
});
|
||||
|
||||
it("accepts gh pr checkout commands with raw numbers", () => {
|
||||
expect(parsePullRequestReference("gh pr checkout 42")).toBe("42");
|
||||
});
|
||||
|
||||
it("accepts gh pr checkout commands with #number references", () => {
|
||||
expect(parsePullRequestReference("gh pr checkout #42")).toBe("#42");
|
||||
});
|
||||
|
||||
it("accepts gh pr checkout commands with GitHub pull request URLs", () => {
|
||||
expect(
|
||||
parsePullRequestReference("gh pr checkout https://github.com/pingdotgg/t3code/pull/42"),
|
||||
).toBe("https://github.com/pingdotgg/t3code/pull/42");
|
||||
});
|
||||
|
||||
it("rejects non-pull-request input", () => {
|
||||
expect(parsePullRequestReference("feature/my-branch")).toBeNull();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user