Skip to content

Commit

Permalink
Merge pull request #33 from cohow/format
Browse files Browse the repository at this point in the history
fix: fixed /stop formatting
  • Loading branch information
Keyrxng authored Sep 2, 2024
2 parents 9a7bc37 + 43244a9 commit ddd787b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/handlers/shared/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function stop(context: Context, issue: Context["payload"]["issue"],
const userToUnassign = assignees.find((assignee: Partial<Assignee>) => assignee?.login?.toLowerCase() === sender.login.toLowerCase());

if (!userToUnassign) {
throw new Error(logger.error("You are not assigned to this task", { issueNumber, user: sender.login })?.logMessage.diff as string);
throw new Error(logger.error("You are not assigned to this task", { issueNumber, user: sender.login })?.logMessage.raw as string);
}

// close PR
Expand Down
4 changes: 2 additions & 2 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe("User start/stop", () => {

context.adapters = createAdapters(getSupabase(), context);

await expect(userStartStop(context as unknown as Context)).rejects.toThrow("```diff\n! You are not assigned to this task\n```");
await expect(userStartStop(context as unknown as Context)).rejects.toThrow("You are not assigned to this task");
});

test("User can't stop an issue without assignees", async () => {
Expand All @@ -115,7 +115,7 @@ describe("User start/stop", () => {
const context = createContext(issue, sender, "/stop");
context.adapters = createAdapters(getSupabase(), context as unknown as Context);

await expect(userStartStop(context as unknown as Context)).rejects.toThrow("```diff\n! You are not assigned to this task\n```");
await expect(userStartStop(context as unknown as Context)).rejects.toThrow("You are not assigned to this task");
});

test("User can't start an issue that's already assigned", async () => {
Expand Down

0 comments on commit ddd787b

Please sign in to comment.