claude-issue-solver 1.43.3 → 1.43.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const vitest_1 = require("vitest");
|
|
37
|
+
// Mock the dependencies
|
|
38
|
+
vitest_1.vi.mock('../utils/github', () => ({
|
|
39
|
+
listIssues: vitest_1.vi.fn(),
|
|
40
|
+
getIssuesWithOpenPRs: vitest_1.vi.fn(() => new Set()),
|
|
41
|
+
}));
|
|
42
|
+
vitest_1.vi.mock('../utils/git', () => ({
|
|
43
|
+
getProjectName: vitest_1.vi.fn(() => 'test-project'),
|
|
44
|
+
}));
|
|
45
|
+
const github_1 = require("../utils/github");
|
|
46
|
+
(0, vitest_1.describe)('list command options', () => {
|
|
47
|
+
(0, vitest_1.beforeEach)(() => {
|
|
48
|
+
vitest_1.vi.clearAllMocks();
|
|
49
|
+
// Suppress console.log during tests
|
|
50
|
+
vitest_1.vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.afterEach)(() => {
|
|
53
|
+
vitest_1.vi.restoreAllMocks();
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.describe)('limit option handling', () => {
|
|
56
|
+
(0, vitest_1.it)('should use default limit of 50 when no options provided', async () => {
|
|
57
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
58
|
+
github_1.listIssues.mockReturnValue([]);
|
|
59
|
+
await listCommand({});
|
|
60
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(50);
|
|
61
|
+
});
|
|
62
|
+
(0, vitest_1.it)('should use limit 0 when --all option is provided', async () => {
|
|
63
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
64
|
+
github_1.listIssues.mockReturnValue([]);
|
|
65
|
+
await listCommand({ all: true });
|
|
66
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(0);
|
|
67
|
+
});
|
|
68
|
+
(0, vitest_1.it)('should use custom limit when --limit option is provided', async () => {
|
|
69
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
70
|
+
github_1.listIssues.mockReturnValue([]);
|
|
71
|
+
await listCommand({ limit: 100 });
|
|
72
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(100);
|
|
73
|
+
});
|
|
74
|
+
(0, vitest_1.it)('should prioritize --all over --limit when both provided', async () => {
|
|
75
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
76
|
+
github_1.listIssues.mockReturnValue([]);
|
|
77
|
+
await listCommand({ all: true, limit: 100 });
|
|
78
|
+
// --all should take precedence, setting limit to 0
|
|
79
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(0);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
(0, vitest_1.describe)('hint message', () => {
|
|
83
|
+
(0, vitest_1.it)('should show hint when hitting default limit of 50', async () => {
|
|
84
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
85
|
+
const mockConsoleLog = vitest_1.vi.spyOn(console, 'log');
|
|
86
|
+
// Return exactly 50 issues to trigger the hint
|
|
87
|
+
const fiftyIssues = Array.from({ length: 50 }, (_, i) => ({
|
|
88
|
+
number: i + 1,
|
|
89
|
+
title: `Issue ${i + 1}`,
|
|
90
|
+
body: '',
|
|
91
|
+
labels: [],
|
|
92
|
+
}));
|
|
93
|
+
github_1.listIssues.mockReturnValue(fiftyIssues);
|
|
94
|
+
await listCommand({});
|
|
95
|
+
// Should show hint about using --limit or --all
|
|
96
|
+
(0, vitest_1.expect)(mockConsoleLog).toHaveBeenCalledWith(vitest_1.expect.stringContaining('--limit'));
|
|
97
|
+
});
|
|
98
|
+
(0, vitest_1.it)('should not show hint when --all is used', async () => {
|
|
99
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
100
|
+
const mockConsoleLog = vitest_1.vi.spyOn(console, 'log');
|
|
101
|
+
const fiftyIssues = Array.from({ length: 50 }, (_, i) => ({
|
|
102
|
+
number: i + 1,
|
|
103
|
+
title: `Issue ${i + 1}`,
|
|
104
|
+
body: '',
|
|
105
|
+
labels: [],
|
|
106
|
+
}));
|
|
107
|
+
github_1.listIssues.mockReturnValue(fiftyIssues);
|
|
108
|
+
await listCommand({ all: true });
|
|
109
|
+
// Should NOT show hint about using --limit or --all
|
|
110
|
+
const calls = mockConsoleLog.mock.calls.flat().join(' ');
|
|
111
|
+
(0, vitest_1.expect)(calls).not.toContain('Use --limit');
|
|
112
|
+
});
|
|
113
|
+
(0, vitest_1.it)('should not show hint when custom --limit is used', async () => {
|
|
114
|
+
const { listCommand } = await Promise.resolve().then(() => __importStar(require('./list')));
|
|
115
|
+
const mockConsoleLog = vitest_1.vi.spyOn(console, 'log');
|
|
116
|
+
const issues = Array.from({ length: 25 }, (_, i) => ({
|
|
117
|
+
number: i + 1,
|
|
118
|
+
title: `Issue ${i + 1}`,
|
|
119
|
+
body: '',
|
|
120
|
+
labels: [],
|
|
121
|
+
}));
|
|
122
|
+
github_1.listIssues.mockReturnValue(issues);
|
|
123
|
+
await listCommand({ limit: 25 });
|
|
124
|
+
// Should NOT show hint about using --limit or --all
|
|
125
|
+
const calls = mockConsoleLog.mock.calls.flat().join(' ');
|
|
126
|
+
(0, vitest_1.expect)(calls).not.toContain('Use --limit');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const vitest_1 = require("vitest");
|
|
37
|
+
// Mock the dependencies
|
|
38
|
+
vitest_1.vi.mock('../utils/github', () => ({
|
|
39
|
+
listIssues: vitest_1.vi.fn(),
|
|
40
|
+
getIssuesWithOpenPRs: vitest_1.vi.fn(() => new Set()),
|
|
41
|
+
}));
|
|
42
|
+
vitest_1.vi.mock('../utils/git', () => ({
|
|
43
|
+
getProjectName: vitest_1.vi.fn(() => 'test-project'),
|
|
44
|
+
}));
|
|
45
|
+
vitest_1.vi.mock('./solve', () => ({
|
|
46
|
+
solveCommand: vitest_1.vi.fn(),
|
|
47
|
+
}));
|
|
48
|
+
vitest_1.vi.mock('inquirer', () => ({
|
|
49
|
+
default: {
|
|
50
|
+
prompt: vitest_1.vi.fn(() => Promise.resolve({ issueNumbers: [] })),
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
53
|
+
const github_1 = require("../utils/github");
|
|
54
|
+
(0, vitest_1.describe)('select command options', () => {
|
|
55
|
+
(0, vitest_1.beforeEach)(() => {
|
|
56
|
+
vitest_1.vi.clearAllMocks();
|
|
57
|
+
// Suppress console.log during tests
|
|
58
|
+
vitest_1.vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.afterEach)(() => {
|
|
61
|
+
vitest_1.vi.restoreAllMocks();
|
|
62
|
+
});
|
|
63
|
+
(0, vitest_1.describe)('limit option handling', () => {
|
|
64
|
+
(0, vitest_1.it)('should use default limit of 50 when no options provided', async () => {
|
|
65
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
66
|
+
github_1.listIssues.mockReturnValue([]);
|
|
67
|
+
await selectCommand({});
|
|
68
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(50);
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.it)('should use limit 0 when --all option is provided', async () => {
|
|
71
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
72
|
+
github_1.listIssues.mockReturnValue([]);
|
|
73
|
+
await selectCommand({ all: true });
|
|
74
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(0);
|
|
75
|
+
});
|
|
76
|
+
(0, vitest_1.it)('should use custom limit when --limit option is provided', async () => {
|
|
77
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
78
|
+
github_1.listIssues.mockReturnValue([]);
|
|
79
|
+
await selectCommand({ limit: 100 });
|
|
80
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(100);
|
|
81
|
+
});
|
|
82
|
+
(0, vitest_1.it)('should prioritize --all over --limit when both provided', async () => {
|
|
83
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
84
|
+
github_1.listIssues.mockReturnValue([]);
|
|
85
|
+
await selectCommand({ all: true, limit: 100 });
|
|
86
|
+
// --all should take precedence, setting limit to 0
|
|
87
|
+
(0, vitest_1.expect)(github_1.listIssues).toHaveBeenCalledWith(0);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
(0, vitest_1.describe)('hint message', () => {
|
|
91
|
+
(0, vitest_1.it)('should show hint when hitting default limit of 50', async () => {
|
|
92
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
93
|
+
const mockConsoleLog = vitest_1.vi.spyOn(console, 'log');
|
|
94
|
+
// Return exactly 50 issues to trigger the hint
|
|
95
|
+
const fiftyIssues = Array.from({ length: 50 }, (_, i) => ({
|
|
96
|
+
number: i + 1,
|
|
97
|
+
title: `Issue ${i + 1}`,
|
|
98
|
+
body: '',
|
|
99
|
+
labels: [],
|
|
100
|
+
}));
|
|
101
|
+
github_1.listIssues.mockReturnValue(fiftyIssues);
|
|
102
|
+
await selectCommand({});
|
|
103
|
+
// Should show hint about using --limit or --all
|
|
104
|
+
(0, vitest_1.expect)(mockConsoleLog).toHaveBeenCalledWith(vitest_1.expect.stringContaining('--limit'));
|
|
105
|
+
});
|
|
106
|
+
(0, vitest_1.it)('should not show hint when --all is used', async () => {
|
|
107
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
108
|
+
const mockConsoleLog = vitest_1.vi.spyOn(console, 'log');
|
|
109
|
+
const fiftyIssues = Array.from({ length: 50 }, (_, i) => ({
|
|
110
|
+
number: i + 1,
|
|
111
|
+
title: `Issue ${i + 1}`,
|
|
112
|
+
body: '',
|
|
113
|
+
labels: [],
|
|
114
|
+
}));
|
|
115
|
+
github_1.listIssues.mockReturnValue(fiftyIssues);
|
|
116
|
+
await selectCommand({ all: true });
|
|
117
|
+
// Should NOT show hint about using --limit or --all
|
|
118
|
+
const calls = mockConsoleLog.mock.calls.flat().join(' ');
|
|
119
|
+
(0, vitest_1.expect)(calls).not.toContain('Use --limit');
|
|
120
|
+
});
|
|
121
|
+
(0, vitest_1.it)('should not show hint when custom --limit is used', async () => {
|
|
122
|
+
const { selectCommand } = await Promise.resolve().then(() => __importStar(require('./select')));
|
|
123
|
+
const mockConsoleLog = vitest_1.vi.spyOn(console, 'log');
|
|
124
|
+
const issues = Array.from({ length: 25 }, (_, i) => ({
|
|
125
|
+
number: i + 1,
|
|
126
|
+
title: `Issue ${i + 1}`,
|
|
127
|
+
body: '',
|
|
128
|
+
labels: [],
|
|
129
|
+
}));
|
|
130
|
+
github_1.listIssues.mockReturnValue(issues);
|
|
131
|
+
await selectCommand({ limit: 25 });
|
|
132
|
+
// Should NOT show hint about using --limit or --all
|
|
133
|
+
const calls = mockConsoleLog.mock.calls.flat().join(' ');
|
|
134
|
+
(0, vitest_1.expect)(calls).not.toContain('Use --limit');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
});
|