@atlassian-dc-mcp/bitbucket 0.6.0 → 0.7.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/build/__tests__/bitbucket-service.test.d.ts +2 -0
  3. package/build/__tests__/bitbucket-service.test.d.ts.map +1 -0
  4. package/build/__tests__/bitbucket-service.test.js +269 -0
  5. package/build/__tests__/bitbucket-service.test.js.map +1 -0
  6. package/build/__tests__/pr-changes-mapper.test.d.ts +2 -0
  7. package/build/__tests__/pr-changes-mapper.test.d.ts.map +1 -0
  8. package/build/__tests__/pr-changes-mapper.test.js +396 -0
  9. package/build/__tests__/pr-changes-mapper.test.js.map +1 -0
  10. package/build/__tests__/pr-comment-mapper.test.d.ts +2 -0
  11. package/build/__tests__/pr-comment-mapper.test.d.ts.map +1 -0
  12. package/build/__tests__/pr-comment-mapper.test.js +210 -0
  13. package/build/__tests__/pr-comment-mapper.test.js.map +1 -0
  14. package/build/bitbucket-service.d.ts +84 -1
  15. package/build/bitbucket-service.d.ts.map +1 -1
  16. package/build/bitbucket-service.js +148 -1
  17. package/build/bitbucket-service.js.map +1 -1
  18. package/build/index.js +13 -1
  19. package/build/index.js.map +1 -1
  20. package/build/pr-changes-mapper.d.ts +32 -0
  21. package/build/pr-changes-mapper.d.ts.map +1 -0
  22. package/build/pr-changes-mapper.js +111 -0
  23. package/build/pr-changes-mapper.js.map +1 -0
  24. package/build/pr-comment-mapper.d.ts +48 -0
  25. package/build/pr-comment-mapper.d.ts.map +1 -0
  26. package/build/pr-comment-mapper.js +128 -0
  27. package/build/pr-comment-mapper.js.map +1 -0
  28. package/jest.config.js +23 -0
  29. package/package.json +5 -3
  30. package/src/__tests__/bitbucket-service.test.ts +419 -0
  31. package/src/__tests__/pr-changes-mapper.test.ts +420 -0
  32. package/src/__tests__/pr-comment-mapper.test.ts +230 -0
  33. package/src/bitbucket-service.ts +215 -2
  34. package/src/index.ts +33 -2
  35. package/src/pr-changes-mapper.ts +216 -0
  36. package/src/pr-comment-mapper.ts +318 -0
  37. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,420 @@
1
+ import {
2
+ simplifyBitbucketPRChanges,
3
+ getChangesSummary
4
+ } from '../pr-changes-mapper.js';
5
+
6
+ describe('PR Changes Mapper', () => {
7
+ // Test data based on the example from the issue description
8
+ const validPRChangesResponse = {
9
+ "fromHash": "abc123def456789012345678901234567890abcd",
10
+ "toHash": "def456abc789012345678901234567890123cdef",
11
+ "properties": {
12
+ "changeScope": "ALL"
13
+ },
14
+ "values": [
15
+ {
16
+ "contentId": "content123456789abcdef0123456789abcdef01234",
17
+ "fromContentId": "content123456789abcdef0123456789abcdef01234",
18
+ "path": {
19
+ "components": [
20
+ "src",
21
+ "MyProject",
22
+ "Handlers",
23
+ "Api",
24
+ "ImageProcessor",
25
+ "ImageHandler.cs"
26
+ ],
27
+ "parent": "src/MyProject/Handlers/Api/ImageProcessor",
28
+ "name": "ImageHandler.cs",
29
+ "extension": "cs",
30
+ "toString": "src/MyProject/Handlers/Api/ImageProcessor/ImageHandler.cs"
31
+ },
32
+ "percentUnchanged": -1,
33
+ "type": "DELETE",
34
+ "nodeType": "FILE",
35
+ "srcExecutable": false,
36
+ "links": {
37
+ "self": [
38
+ null
39
+ ]
40
+ },
41
+ "properties": {
42
+ "gitChangeType": "DELETE"
43
+ }
44
+ },
45
+ {
46
+ "contentId": "content456789abcdef0123456789abcdef012345678",
47
+ "fromContentId": "0000000000000000000000000000000000000000",
48
+ "path": {
49
+ "components": [
50
+ "src",
51
+ "MyProject",
52
+ "Handlers",
53
+ "Api",
54
+ "ProcessorService",
55
+ "ProcessorHandler.cs"
56
+ ],
57
+ "parent": "src/MyProject/Handlers/Api/ProcessorService",
58
+ "name": "ProcessorHandler.cs",
59
+ "extension": "cs",
60
+ "toString": "src/MyProject/Handlers/Api/ProcessorService/ProcessorHandler.cs"
61
+ },
62
+ "executable": false,
63
+ "percentUnchanged": -1,
64
+ "type": "ADD",
65
+ "nodeType": "FILE",
66
+ "links": {
67
+ "self": [
68
+ null
69
+ ]
70
+ },
71
+ "properties": {
72
+ "gitChangeType": "ADD"
73
+ }
74
+ },
75
+ {
76
+ "contentId": "content789abcdef0123456789abcdef0123456789ab",
77
+ "fromContentId": "content987654321fedcba0987654321fedcba098765",
78
+ "path": {
79
+ "components": [
80
+ "src",
81
+ "MyProject",
82
+ "Extensions",
83
+ "DatabaseExtensions.cs"
84
+ ],
85
+ "parent": "src/MyProject/Extensions",
86
+ "name": "DatabaseExtensions.cs",
87
+ "extension": "cs",
88
+ "toString": "src/MyProject/Extensions/DatabaseExtensions.cs"
89
+ },
90
+ "executable": false,
91
+ "percentUnchanged": -1,
92
+ "type": "MODIFY",
93
+ "nodeType": "FILE",
94
+ "srcExecutable": false,
95
+ "links": {
96
+ "self": [
97
+ null
98
+ ]
99
+ },
100
+ "properties": {
101
+ "gitChangeType": "MODIFY"
102
+ }
103
+ },
104
+ {
105
+ "contentId": "contentabcdef0123456789abcdef0123456789abcd",
106
+ "fromContentId": "0000000000000000000000000000000000000000",
107
+ "path": {
108
+ "components": [
109
+ "src",
110
+ "MyProject",
111
+ "Services",
112
+ "EventHandlers",
113
+ "RequestHandler.cs"
114
+ ],
115
+ "parent": "src/MyProject/Services/EventHandlers",
116
+ "name": "RequestHandler.cs",
117
+ "extension": "cs",
118
+ "toString": "src/MyProject/Services/EventHandlers/RequestHandler.cs"
119
+ },
120
+ "executable": false,
121
+ "percentUnchanged": -1,
122
+ "type": "ADD",
123
+ "nodeType": "FILE",
124
+ "links": {
125
+ "self": [
126
+ null
127
+ ]
128
+ },
129
+ "properties": {
130
+ "orphanedComments": 0,
131
+ "gitChangeType": "ADD",
132
+ "activeComments": 1
133
+ }
134
+ },
135
+ {
136
+ "contentId": "contentdef0123456789abcdef0123456789abcdef01",
137
+ "fromContentId": "contentfedcba9876543210fedcba9876543210fedcb",
138
+ "path": {
139
+ "components": [
140
+ "tests",
141
+ "MyProject.Tests",
142
+ "Handlers",
143
+ "Api",
144
+ "ProcessorHandlerTests.cs"
145
+ ],
146
+ "parent": "tests/MyProject.Tests/Handlers/Api",
147
+ "name": "ProcessorHandlerTests.cs",
148
+ "extension": "cs",
149
+ "toString": "tests/MyProject.Tests/Handlers/Api/ProcessorHandlerTests.cs"
150
+ },
151
+ "executable": false,
152
+ "percentUnchanged": 54,
153
+ "type": "MOVE",
154
+ "nodeType": "FILE",
155
+ "srcPath": {
156
+ "components": [
157
+ "tests",
158
+ "MyProject.Tests",
159
+ "Handlers",
160
+ "Api",
161
+ "ImageHandlerTests.cs"
162
+ ],
163
+ "parent": "tests/MyProject.Tests/Handlers/Api",
164
+ "name": "ImageHandlerTests.cs",
165
+ "extension": "cs",
166
+ "toString": "tests/MyProject.Tests/Handlers/Api/ImageHandlerTests.cs"
167
+ },
168
+ "srcExecutable": false,
169
+ "links": {
170
+ "self": [
171
+ null
172
+ ]
173
+ },
174
+ "properties": {
175
+ "gitChangeType": "RENAME"
176
+ }
177
+ }
178
+ ],
179
+ "size": 5,
180
+ "isLastPage": true,
181
+ "start": 0,
182
+ "limit": 25,
183
+ "nextPageStart": null
184
+ };
185
+
186
+ describe('simplifyBitbucketPRChanges', () => {
187
+ it('should simplify valid PR changes response correctly', () => {
188
+ const result = simplifyBitbucketPRChanges(validPRChangesResponse);
189
+
190
+ const expectedResult = {
191
+ fromHash: 'abc123def456789012345678901234567890abcd',
192
+ toHash: 'def456abc789012345678901234567890123cdef',
193
+ changeScope: 'ALL',
194
+ changes: [
195
+ {
196
+ contentId: 'content123456789abcdef0123456789abcdef01234',
197
+ path: {
198
+ name: 'ImageHandler.cs',
199
+ path: 'src/MyProject/Handlers/Api/ImageProcessor/ImageHandler.cs',
200
+ extension: 'cs'
201
+ },
202
+ type: 'DELETE',
203
+ gitChangeType: 'DELETE'
204
+ },
205
+ {
206
+ contentId: 'content456789abcdef0123456789abcdef012345678',
207
+ path: {
208
+ name: 'ProcessorHandler.cs',
209
+ path: 'src/MyProject/Handlers/Api/ProcessorService/ProcessorHandler.cs',
210
+ extension: 'cs'
211
+ },
212
+ type: 'ADD',
213
+ gitChangeType: 'ADD'
214
+ },
215
+ {
216
+ contentId: 'content789abcdef0123456789abcdef0123456789ab',
217
+ path: {
218
+ name: 'DatabaseExtensions.cs',
219
+ path: 'src/MyProject/Extensions/DatabaseExtensions.cs',
220
+ extension: 'cs'
221
+ },
222
+ type: 'MODIFY',
223
+ gitChangeType: 'MODIFY'
224
+ },
225
+ {
226
+ contentId: 'contentabcdef0123456789abcdef0123456789abcd',
227
+ path: {
228
+ name: 'RequestHandler.cs',
229
+ path: 'src/MyProject/Services/EventHandlers/RequestHandler.cs',
230
+ extension: 'cs'
231
+ },
232
+ type: 'ADD',
233
+ gitChangeType: 'ADD',
234
+ comments: 1
235
+ },
236
+ {
237
+ contentId: 'contentdef0123456789abcdef0123456789abcdef01',
238
+ path: {
239
+ name: 'ProcessorHandlerTests.cs',
240
+ path: 'tests/MyProject.Tests/Handlers/Api/ProcessorHandlerTests.cs',
241
+ extension: 'cs'
242
+ },
243
+ srcPath: {
244
+ name: 'ImageHandlerTests.cs',
245
+ path: 'tests/MyProject.Tests/Handlers/Api/ImageHandlerTests.cs',
246
+ extension: 'cs'
247
+ },
248
+ type: 'MOVE',
249
+ gitChangeType: 'RENAME'
250
+ }
251
+ ],
252
+ summary: {
253
+ totalChanges: 5,
254
+ additions: 2,
255
+ deletions: 1,
256
+ modifications: 1,
257
+ moves: 1,
258
+ filesWithComments: 1
259
+ },
260
+ isLastPage: true
261
+ };
262
+
263
+ expect(result).toEqual(expectedResult);
264
+ });
265
+
266
+ it('should handle malformed input gracefully', () => {
267
+ const malformedInput = { invalid: 'data' } as any;
268
+ const result = simplifyBitbucketPRChanges(malformedInput);
269
+
270
+ // Should return original response for malformed input
271
+ expect(result).toBe(malformedInput);
272
+ });
273
+
274
+ it('should handle empty values array', () => {
275
+ const emptyResponse = {
276
+ "fromHash": "abc123",
277
+ "toHash": "def456",
278
+ "properties": {
279
+ "changeScope": "ALL"
280
+ },
281
+ "values": [],
282
+ "size": 0,
283
+ "isLastPage": true,
284
+ "start": 0,
285
+ "limit": 25,
286
+ "nextPageStart": null
287
+ };
288
+
289
+ const result = simplifyBitbucketPRChanges(emptyResponse);
290
+
291
+ const expectedResult = {
292
+ fromHash: "abc123",
293
+ toHash: "def456",
294
+ changeScope: "ALL",
295
+ changes: [],
296
+ summary: {
297
+ totalChanges: 0,
298
+ additions: 0,
299
+ deletions: 0,
300
+ modifications: 0,
301
+ moves: 0,
302
+ filesWithComments: 0
303
+ },
304
+ isLastPage: true
305
+ };
306
+
307
+ expect(result).toEqual(expectedResult);
308
+ });
309
+
310
+ it('should reduce response size significantly', () => {
311
+ const originalSize = JSON.stringify(validPRChangesResponse).length;
312
+ const simplified = simplifyBitbucketPRChanges(validPRChangesResponse);
313
+ const simplifiedSize = JSON.stringify(simplified).length;
314
+
315
+ const reduction = (originalSize - simplifiedSize) / originalSize;
316
+ expect(reduction).toBeGreaterThan(0.4); // At least 40% reduction
317
+
318
+ console.log(`Original size: ${originalSize} characters`);
319
+ console.log(`Simplified size: ${simplifiedSize} characters`);
320
+ console.log(`Reduction: ${(reduction * 100).toFixed(1)}%`);
321
+ });
322
+
323
+ it('should handle missing optional fields gracefully', () => {
324
+ const responseWithMissingFields = {
325
+ ...validPRChangesResponse,
326
+ values: [
327
+ {
328
+ "contentId": "test123",
329
+ "fromContentId": "test456",
330
+ "path": {
331
+ "components": ["test"],
332
+ "parent": "",
333
+ "name": "test.txt",
334
+ "extension": "txt",
335
+ "toString": "test.txt"
336
+ },
337
+ "type": "ADD",
338
+ "properties": {
339
+ "gitChangeType": "ADD"
340
+ }
341
+ }
342
+ ]
343
+ };
344
+
345
+ const result = simplifyBitbucketPRChanges(responseWithMissingFields);
346
+
347
+ const expectedResult = {
348
+ fromHash: 'abc123def456789012345678901234567890abcd',
349
+ toHash: 'def456abc789012345678901234567890123cdef',
350
+ changeScope: 'ALL',
351
+ changes: [
352
+ {
353
+ contentId: "test123",
354
+ path: {
355
+ name: "test.txt",
356
+ path: "test.txt",
357
+ extension: "txt"
358
+ },
359
+ type: "ADD",
360
+ gitChangeType: "ADD"
361
+ // Note: no 'comments' or 'srcPath' properties as they are optional and missing
362
+ }
363
+ ],
364
+ summary: {
365
+ totalChanges: 1,
366
+ additions: 1,
367
+ deletions: 0,
368
+ modifications: 0,
369
+ moves: 0,
370
+ filesWithComments: 0
371
+ },
372
+ isLastPage: true
373
+ };
374
+
375
+ expect(result).toEqual(expectedResult);
376
+ });
377
+ });
378
+
379
+ describe('getChangesSummary', () => {
380
+ it('should return changes summaries as string array', () => {
381
+ const summary = getChangesSummary(validPRChangesResponse);
382
+ expect(Array.isArray(summary)).toBe(true);
383
+ expect(summary).toHaveLength(5);
384
+
385
+ expect(summary[0]).toContain('Deleted: src/MyProject/Handlers/Api/ImageProcessor/ImageHandler.cs');
386
+ expect(summary[1]).toContain('Added: src/MyProject/Handlers/Api/ProcessorService/ProcessorHandler.cs');
387
+ expect(summary[2]).toContain('Modified: src/MyProject/Extensions/DatabaseExtensions.cs');
388
+ expect(summary[3]).toContain('Added: src/MyProject/Services/EventHandlers/RequestHandler.cs');
389
+ expect(summary[3]).toContain('[1 comment]');
390
+ expect(summary[4]).toContain('Moved: tests/MyProject.Tests/Handlers/Api/ProcessorHandlerTests.cs');
391
+ expect(summary[4]).toContain('(from tests/MyProject.Tests/Handlers/Api/ImageHandlerTests.cs)');
392
+ });
393
+
394
+ it('should handle malformed input gracefully', () => {
395
+ const summary = getChangesSummary({ invalid: 'data' } as any);
396
+ expect(Array.isArray(summary)).toBe(true);
397
+ expect(summary).toHaveLength(0);
398
+ });
399
+
400
+ it('should handle empty values array', () => {
401
+ const emptyResponse = {
402
+ "fromHash": "abc123",
403
+ "toHash": "def456",
404
+ "properties": {
405
+ "changeScope": "ALL"
406
+ },
407
+ "values": [],
408
+ "size": 0,
409
+ "isLastPage": true,
410
+ "start": 0,
411
+ "limit": 25,
412
+ "nextPageStart": null
413
+ };
414
+
415
+ const summary = getChangesSummary(emptyResponse);
416
+ expect(Array.isArray(summary)).toBe(true);
417
+ expect(summary).toHaveLength(0);
418
+ });
419
+ });
420
+ });
@@ -0,0 +1,230 @@
1
+ import {
2
+ simplifyBitbucketPRComments,
3
+ getCommentSummary,
4
+ type BitbucketPRApiResponse,
5
+ type SimplifiedPRResponse
6
+ } from '../pr-comment-mapper.js';
7
+
8
+ describe('PR Comment Mapper', () => {
9
+ // Test data from the original ad-hoc test
10
+ const validPRResponse: BitbucketPRApiResponse = {
11
+ size: 2,
12
+ limit: 100,
13
+ isLastPage: true,
14
+ values: [
15
+ {
16
+ id: 1001,
17
+ createdDate: 1600000000000,
18
+ user: {
19
+ name: "testuser1",
20
+ emailAddress: "testuser1@company.local",
21
+ active: true,
22
+ displayName: "User A",
23
+ id: 101,
24
+ slug: "testuser1",
25
+ type: "NORMAL",
26
+ links: {
27
+ self: [{ href: "https://bitbucket.company.local/users/testuser1" }]
28
+ }
29
+ },
30
+ action: "COMMENTED",
31
+ commentAction: "ADDED",
32
+ comment: {
33
+ properties: { repositoryId: 1001 },
34
+ id: 2001,
35
+ version: 0,
36
+ text: "This needs review",
37
+ author: {
38
+ name: "testuser1",
39
+ emailAddress: "testuser1@company.local",
40
+ active: true,
41
+ displayName: "User A",
42
+ id: 101,
43
+ slug: "testuser1",
44
+ type: "NORMAL",
45
+ links: {
46
+ self: [{ href: "https://bitbucket.company.local/users/testuser1" }]
47
+ }
48
+ },
49
+ createdDate: 1600000000000,
50
+ updatedDate: 1600000000000,
51
+ comments: [],
52
+ anchor: {
53
+ fromHash: "abc123def456789012345678901234567890abcd",
54
+ toHash: "def456abc789012345678901234567890123cdef",
55
+ line: 6,
56
+ lineType: "ADDED",
57
+ fileType: "TO",
58
+ path: "config.yml",
59
+ diffType: "EFFECTIVE",
60
+ orphaned: false
61
+ },
62
+ threadResolved: false,
63
+ severity: "NORMAL",
64
+ state: "OPEN",
65
+ permittedOperations: {
66
+ editable: false,
67
+ transitionable: true,
68
+ deletable: false
69
+ }
70
+ }
71
+ },
72
+ {
73
+ id: 1002,
74
+ createdDate: 1600000001000,
75
+ user: {
76
+ name: "testuser2",
77
+ emailAddress: "testuser2@company.local",
78
+ active: true,
79
+ displayName: "User B",
80
+ id: 102,
81
+ slug: "testuser2",
82
+ type: "NORMAL",
83
+ links: {
84
+ self: [{ href: "https://bitbucket.company.local/users/testuser2" }]
85
+ }
86
+ },
87
+ action: "OPENED"
88
+ }
89
+ ],
90
+ start: 0
91
+ };
92
+
93
+ describe('simplifyBitbucketPRComments', () => {
94
+ it('should simplify valid PR response correctly', () => {
95
+ const result = simplifyBitbucketPRComments(validPRResponse) as SimplifiedPRResponse;
96
+
97
+ const expectedResult = {
98
+ isLastPage: true,
99
+ activities: [
100
+ {
101
+ id: 1001,
102
+ createdDate: 1600000000000,
103
+ user: {
104
+ name: "testuser1",
105
+ displayName: "User A"
106
+ },
107
+ action: "COMMENTED",
108
+ commentAction: "ADDED",
109
+ comment: {
110
+ id: 2001,
111
+ text: "This needs review",
112
+ author: {
113
+ name: "testuser1",
114
+ displayName: "User A"
115
+ },
116
+ createdDate: 1600000000000,
117
+ anchor: {
118
+ line: 6,
119
+ path: "config.yml",
120
+ fileType: "TO"
121
+ },
122
+ threadResolved: false,
123
+ state: "OPEN"
124
+ }
125
+ },
126
+ {
127
+ id: 1002,
128
+ createdDate: 1600000001000,
129
+ user: {
130
+ name: "testuser2",
131
+ displayName: "User B"
132
+ },
133
+ action: "OPENED"
134
+ }
135
+ ],
136
+ summary: {
137
+ totalActivities: 2,
138
+ prAuthor: {
139
+ name: "testuser2",
140
+ displayName: "User B"
141
+ },
142
+ commentCount: 1,
143
+ unresolvedCount: 1
144
+ }
145
+ };
146
+
147
+ expect(result).toEqual(expectedResult);
148
+ });
149
+
150
+ it('should handle malformed input gracefully', () => {
151
+ const malformedInput = { invalid: 'data' } as any;
152
+ const result = simplifyBitbucketPRComments(malformedInput) as SimplifiedPRResponse;
153
+
154
+ const expectedResult = {
155
+ isLastPage: true,
156
+ activities: [],
157
+ summary: {
158
+ totalActivities: 0,
159
+ commentCount: 0,
160
+ unresolvedCount: 0
161
+ }
162
+ };
163
+
164
+ expect(result).toEqual(expectedResult);
165
+ });
166
+
167
+ it('should handle empty values array', () => {
168
+ const emptyResponse: BitbucketPRApiResponse = {
169
+ size: 0,
170
+ limit: 100,
171
+ isLastPage: true,
172
+ values: [],
173
+ start: 0
174
+ };
175
+
176
+ const result = simplifyBitbucketPRComments(emptyResponse) as SimplifiedPRResponse;
177
+
178
+ const expectedResult = {
179
+ isLastPage: true,
180
+ activities: [],
181
+ summary: {
182
+ totalActivities: 0,
183
+ commentCount: 0,
184
+ unresolvedCount: 0
185
+ }
186
+ };
187
+
188
+ expect(result).toEqual(expectedResult);
189
+ });
190
+
191
+ it('should reduce response size significantly', () => {
192
+ const originalSize = JSON.stringify(validPRResponse).length;
193
+ const simplified = simplifyBitbucketPRComments(validPRResponse);
194
+ const simplifiedSize = JSON.stringify(simplified).length;
195
+
196
+ const reduction = (originalSize - simplifiedSize) / originalSize;
197
+ expect(reduction).toBeGreaterThan(0.3); // At least 30% reduction
198
+ });
199
+ });
200
+
201
+ describe('getCommentSummary', () => {
202
+ it('should return comment summaries as string array', () => {
203
+ const summary = getCommentSummary(validPRResponse);
204
+ expect(Array.isArray(summary)).toBe(true);
205
+ expect(summary).toHaveLength(1);
206
+ expect(summary[0]).toContain("User A");
207
+ expect(summary[0]).toContain("config.yml");
208
+ expect(summary[0]).toContain("This needs review");
209
+ });
210
+
211
+ it('should handle malformed input gracefully', () => {
212
+ const summary = getCommentSummary({ invalid: 'data' } as any);
213
+ expect(Array.isArray(summary)).toBe(true);
214
+ expect(summary).toHaveLength(0);
215
+ });
216
+
217
+ it('should handle empty values array', () => {
218
+ const emptyResponse: BitbucketPRApiResponse = {
219
+ size: 0,
220
+ limit: 100,
221
+ isLastPage: true,
222
+ values: [],
223
+ start: 0
224
+ };
225
+ const summary = getCommentSummary(emptyResponse);
226
+ expect(Array.isArray(summary)).toBe(true);
227
+ expect(summary).toHaveLength(0);
228
+ });
229
+ });
230
+ });