Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"metadata": {
"description": "GitHits plugins for Claude Code - code examples from global open source",
"version": "0.4.1"
"version": "0.4.2"
},
"plugins": [
{
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "githits",
"version": "0.4.1",
"version": "0.4.2",
"description": "Code examples from global open source for developers and AI assistants",
"author": {
"name": "GitHits"
Expand Down
2 changes: 1 addition & 1 deletion .plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "githits",
"version": "0.4.1",
"version": "0.4.2",
"description": "Code examples from global open source for developers and AI assistants",
"author": {
"name": "GitHits"
Expand Down
2 changes: 1 addition & 1 deletion gemini-extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "githits",
"version": "0.4.1",
"version": "0.4.2",
"description": "Code examples from global open source for developers and AI assistants.",
"mcpServers": {
"githits": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "githits",
"description": "CLI companion for GitHits - code examples from global open source for developers and AI assistants",
"version": "0.4.1",
"version": "0.4.2",
"type": "module",
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion plugins/claude/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "githits",
"version": "0.4.1",
"version": "0.4.2",
"description": "Code examples from global open source for developers and AI assistants",
"author": {
"name": "GitHits"
Expand Down
16 changes: 15 additions & 1 deletion src/commands/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,24 @@ describe("loginFlow", () => {

it("returns success after completing OAuth flow", async () => {
const consoleSpy = spyOn(console, "log").mockImplementation(() => {});
const close = mock(() => Promise.resolve());
const authService = createMockAuthService({
startCallbackServer: mock(() =>
Promise.resolve({
result: Promise.resolve({
type: "success",
code: "test-code",
state: "test-state",
} as const),
close,
}),
),
});

const result = await loginFlow(
{ port: 8080 },
{
authService: createMockAuthService(),
authService,
authStorage: createMockAuthStorage(),
browserService: createMockBrowserService(),
mcpUrl,
Expand All @@ -408,6 +421,7 @@ describe("loginFlow", () => {

expect(result.status).toBe("success");
expect(result.message).toContain("Logged in successfully");
expect(close).toHaveBeenCalledTimes(1);
consoleSpy.mockRestore();
});

Expand Down
1 change: 1 addition & 0 deletions src/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export async function loginFlow(
try {
callback = await Promise.race([callbackServer.result, timeoutPromise]);
if (timeoutId) clearTimeout(timeoutId);
await callbackServer.close().catch(() => {});
} catch (error) {
if (timeoutId) clearTimeout(timeoutId);
await callbackServer.close().catch(() => {});
Expand Down
Loading