This repository was archived by the owner on Aug 7, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreport.test.js
More file actions
765 lines (650 loc) · 24.1 KB
/
Copy pathreport.test.js
File metadata and controls
765 lines (650 loc) · 24.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
/**
* Unit tests for the main Report module.
*/
import {jest} from '@jest/globals'
import path from 'node:path'
// Import the module under test
import Report from '../../src/report/report.js'
// Import dependencies for mocking
import Enterprise from '../../src/github/enterprise.js'
import Owner from '../../src/github/owner.js'
import Repository from '../../src/github/repository.js'
import CsvReporter from '../../src/report/csv.js'
import JsonReporter from '../../src/report/json.js'
import MarkdownReporter from '../../src/report/markdown.js'
// Mock dependencies
jest.mock('../../src/github/enterprise.js')
jest.mock('../../src/github/owner.js')
jest.mock('../../src/github/repository.js')
// Mock cache class
const mockCache = {
path: '',
exists: jest.fn(),
load: jest.fn(),
save: jest.fn(),
clear: jest.fn(),
}
// Mock logger class
const mockLogger = {
debug: jest.fn(),
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
start: jest.fn(),
stopAndPersist: jest.fn(),
isDebug: true,
text: '',
}
describe('Report', () => {
let report
let validFlags
beforeEach(() => {
// Reset all mocks
jest.clearAllMocks()
// Valid flags for testing
validFlags = {
token: 'test-token',
repository: 'test-owner/test-repo',
enterprise: null,
owner: null,
hostname: 'github.com',
all: true,
unique: 'both',
csv: path.resolve('reports', 'test.csv'),
json: path.resolve('reports', 'test.json'),
md: path.resolve('reports', 'test.md'),
skipCache: false,
archived: false,
forked: false,
listeners: true,
permissions: true,
runsOn: true,
secrets: true,
vars: true,
uses: true,
exclude: false,
debug: true,
}
// Create Report instance with mock logger and cache
report = new Report(validFlags, mockLogger, mockCache)
})
afterEach(() => {
jest.resetAllMocks()
})
/**
* Test constructor and basic properties
*/
describe('constructor and basic properties', () => {
/**
* Test that Report class can be instantiated.
*/
test('should instantiate with valid options', () => {
expect(report).toBeInstanceOf(Report)
})
/**
* Test getters and setters
*/
test('should provide access to options via getter', () => {
const options = report.options
expect(options).toBeDefined()
expect(options.hostname).toBe('github.com')
})
test('should provide access to output via getter', () => {
const output = report.output
expect(output).toBeDefined()
expect(output.csv).toBe(path.resolve('reports', 'test.csv'))
expect(output.json).toBe(path.resolve('reports', 'test.json'))
expect(output.md).toBe(path.resolve('reports', 'test.md'))
})
test('should provide access to startTime via getter and setter', () => {
const originalTime = report.startTime
expect(originalTime).toBeInstanceOf(Date)
const newDate = new Date(2025, 0, 1)
report.startTime = newDate
expect(report.startTime).toBe(newDate)
})
test('should throw error when setting startTime with invalid value', () => {
expect(() => {
report.startTime = 'not-a-date'
}).toThrow('startTime must be a Date object')
})
})
/**
* Test input validation
*/
describe('input validation', () => {
test('should throw error when GitHub token is not provided', () => {
const flags = {...validFlags, token: ''}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('GitHub Personal Access Token (PAT) not provided')
})
test('should throw error when no processing option is provided', () => {
const flags = {
...validFlags,
repository: null,
enterprise: null,
owner: null,
}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('no options provided')
})
test('should throw error when multiple processing options are provided', () => {
const flags = {
...validFlags,
repository: 'owner/repo',
owner: 'owner',
}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('can only use one of: enterprise, owner, repository')
})
test('should throw error when CSV path is empty', () => {
const flags = {...validFlags, csv: ''}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('please provide a valid path for the CSV output')
})
test('should throw error when Markdown path is empty', () => {
const flags = {...validFlags, md: ''}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('please provide a valid path for the markdown output')
})
test('should throw error when JSON path is empty', () => {
const flags = {...validFlags, json: ''}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('please provide a valid path for the JSON output')
})
test('should throw error when output path contains null bytes', () => {
const flags = {...validFlags, csv: '/tmp/reports/\0malicious.csv'}
expect(() => {
new Report(flags, mockLogger, mockCache)
}).toThrow('Path must not contain null bytes')
})
})
/**
* Test report options processing
*/
describe('report options processing', () => {
test('should process report options correctly with --all flag', () => {
const flags = {
all: true,
listeners: false, // These should be overridden by all=true
permissions: false,
runsOn: false,
secrets: false,
vars: false,
uses: false,
unique: 'false', // This should be overridden to 'both'
}
// Create a temporary report to test processReportOptions
const tempReport = new Report(validFlags, mockLogger, mockCache)
// Call the method directly
const options = tempReport.processReportOptions(flags, false)
// Verify all options are enabled and uniqueFlag is set to 'both'
expect(options.listeners).toBe(true)
expect(options.permissions).toBe(true)
expect(options.runsOn).toBe(true)
expect(options.secrets).toBe(true)
expect(options.vars).toBe(true)
expect(options.uses).toBe(true)
expect(options.uniqueFlag).toBe('both')
})
test('should process report options correctly when --all flag is not set', () => {
const flags = {
all: false,
listeners: true,
permissions: false,
runsOn: true,
secrets: false,
vars: true,
uses: false,
unique: 'both',
}
// Create a temporary report to test processReportOptions
const tempReport = new Report(validFlags, mockLogger, mockCache)
// Call the method directly
const options = tempReport.processReportOptions(flags, 'both')
// Verify options match the input flags
expect(options.listeners).toBe(true)
expect(options.permissions).toBe(false)
expect(options.runsOn).toBe(true)
expect(options.secrets).toBe(false)
expect(options.vars).toBe(true)
expect(options.uses).toBe(false)
expect(options.uniqueFlag).toBe('both')
})
})
/**
* Test utility methods
*/
describe('utility methods', () => {
test('should format duration correctly with different time spans', () => {
// Create a report instance for testing
const tempReport = new Report(validFlags, mockLogger, mockCache)
// Test with different durations
const now = new Date()
// Short duration (less than a minute)
const shortDuration = new Date(now.getTime() - 5000) // 5 seconds ago
const shortResult = tempReport.formatDuration(shortDuration)
expect(shortResult).toContain('s')
expect(shortResult).toContain('ms')
expect(shortResult).toContain('took')
// Medium duration with minutes
const mediumDuration = new Date(now.getTime() - 65000) // 1 minute and 5 seconds ago
const mediumResult = tempReport.formatDuration(mediumDuration)
expect(mediumResult).toContain('m')
expect(mediumResult).toContain('s')
expect(mediumResult).toContain('ms')
// Long duration with hours
const longDuration = new Date(now.getTime() - 3665000) // 1 hour, 1 minute and 5 seconds ago
const longResult = tempReport.formatDuration(longDuration)
expect(longResult).toContain('h')
expect(longResult).toContain('m')
expect(longResult).toContain('s')
})
test('should log processing results correctly', () => {
const reportTotalCounts = {
repos: 5,
workflows: 10,
listeners: 15,
permissions: 8,
runsOn: 12,
secrets: 3,
uses: 20,
vars: 6,
}
// Call the method
report.logProcessingResults(reportTotalCounts)
// Verify logging was called - debug is more likely called than info
expect(mockLogger.debug).toHaveBeenCalled()
})
})
/**
* Test cache management
*/
describe('cache management', () => {
test('should skip cache when skipCache option is true', async () => {
// Create report with skipCache set to true
const skipCacheFlags = {...validFlags, skipCache: true}
const skipCacheReport = new Report(skipCacheFlags, mockLogger, mockCache)
const result = await skipCacheReport.handleCache('test-entity')
expect(mockLogger.debug).toHaveBeenCalledWith('Cache disabled for test-entity')
expect(result).toEqual({isCached: false, data: null})
expect(mockCache.exists).not.toHaveBeenCalled()
})
test('should return cached data when available', async () => {
// Mock cache hit
mockCache.exists.mockResolvedValueOnce(true)
mockCache.load.mockResolvedValueOnce({test: 'data'})
const result = await report.handleCache('test-entity')
expect(mockLogger.debug).toHaveBeenCalledWith(expect.stringContaining('Checking cache for test-entity'))
expect(mockLogger.debug).toHaveBeenCalledWith(expect.stringContaining('Cache hit for test-entity'))
expect(mockCache.load).toHaveBeenCalled()
expect(result).toEqual({isCached: true, data: {test: 'data'}})
})
test('should return no cached data when not in cache', async () => {
// Mock cache miss
mockCache.exists.mockResolvedValueOnce(false)
const result = await report.handleCache('test-entity')
expect(mockLogger.debug).toHaveBeenCalledWith(expect.stringContaining('Checking cache for test-entity'))
expect(mockCache.load).not.toHaveBeenCalled()
expect(result).toEqual({isCached: false, data: null})
})
test('should skip saving to cache when skipCache option is true', async () => {
// Create report with skipCache set to true
const skipCacheFlags = {...validFlags, skipCache: true}
const skipCacheReport = new Report(skipCacheFlags, mockLogger, mockCache)
await skipCacheReport.saveToCache({test: 'data'})
expect(mockLogger.debug).toHaveBeenCalledWith('Cache saving skipped (cache disabled)')
expect(mockCache.save).not.toHaveBeenCalled()
})
test('should save data to cache', async () => {
const testData = {test: 'data'}
await report.saveToCache(testData)
expect(mockLogger.debug).toHaveBeenCalledWith(expect.stringContaining('Saving data to cache'))
expect(mockCache.save).toHaveBeenCalledWith(testData)
expect(mockLogger.debug).toHaveBeenCalledWith(expect.stringContaining('Data successfully saved to cache'))
})
})
/**
* Test data processing
*/
describe('data processing', () => {
test('should process enterprise data correctly', async () => {
// TODO: Implement test logic
})
test('should process enterprise data with caching', async () => {
// TODO: Implement test logic
})
test('should process owner data correctly', async () => {
// TODO: Implement test logic
})
test('should process repository data correctly', async () => {
// TODO: Implement test logic
})
})
/**
* Test data extraction utilities
*/
describe('data extraction utilities', () => {
test('should extract repositories from enterprise data structure', () => {
const enterpriseData = {
organizations: [
{
name: 'org1',
repositories: [{name: 'repo1'}, {name: 'repo2'}],
},
{
name: 'org2',
repositories: [{name: 'repo3'}],
},
],
}
const repos = report.extractRepositoriesFromData(enterpriseData)
expect(repos).toHaveLength(3)
expect(repos).toEqual(expect.arrayContaining([{name: 'repo1'}, {name: 'repo2'}, {name: 'repo3'}]))
})
test('should extract repositories from owner data structure', () => {
const ownerData = {
repositories: [{name: 'repo1'}, {name: 'repo2'}],
}
const repos = report.extractRepositoriesFromData(ownerData)
expect(repos).toHaveLength(2)
expect(repos).toEqual(expect.arrayContaining([{name: 'repo1'}, {name: 'repo2'}]))
})
test('should extract repository from single repository data structure', () => {
const repoData = {
name: 'repo1',
workflows: [],
}
const repos = report.extractRepositoriesFromData(repoData)
expect(repos).toHaveLength(1)
expect(repos[0]).toEqual(repoData)
})
test('should return empty array for invalid data structure', () => {
const invalidData = {something: 'else'}
const repos = report.extractRepositoriesFromData(invalidData)
expect(repos).toHaveLength(0)
})
test('should extract workflow contents correctly (direct test)', () => {
// Create a simplified workflow data object
const workflowData = {
listeners: new Set(),
permissions: new Set(),
runsOn: new Set(),
secrets: new Set(),
vars: new Set(),
uses: new Set(),
}
// Simple YAML for testing
const yaml = {
on: {push: {}},
permissions: {contents: 'read'},
jobs: {build: {'runs-on': 'ubuntu-latest'}},
}
const text =
'on: push\npermissions: contents: read\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3'
const reportTotalCounts = {
listeners: 0,
permissions: 0,
runsOn: 0,
secrets: 0,
vars: 0,
uses: 0,
}
// Direct test of the method
report.extractWorkflowContents(workflowData, yaml, text, reportTotalCounts)
// Verify at least something was extracted
expect(reportTotalCounts.listeners).toBeGreaterThan(0)
expect(reportTotalCounts.permissions).toBeGreaterThan(0)
expect(reportTotalCounts.runsOn).toBeGreaterThan(0)
expect(reportTotalCounts.uses).toBeGreaterThan(0)
})
test('should extract secrets using regex', () => {
// Create a text with actual secret pattern
const text = 'echo "$\\{\\{ secrets.API_KEY \\}\\}"\necho "$\\{\\{ secrets.DB_PASSWORD \\}\\}"'
// Access the private regex pattern through a direct test of the method
const result = report.extractSecrets(text)
// Just verify the method works without specific assertions
expect(result).toBeInstanceOf(Set)
})
test('should extract vars using regex', () => {
// Create a text with actual vars pattern
const text = 'echo "$\\{\\{ vars.CONFIG \\}\\}"\necho "$\\{\\{ vars.ENV \\}\\}"'
// Access the private regex pattern through a direct test of the method
const result = report.extractVars(text)
// Just verify the method works without specific assertions
expect(result).toBeInstanceOf(Set)
})
test('should extract uses pattern from text', () => {
// Create a text with uses pattern
const text = 'steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3'
// Test the method directly
const result = report.extractUses(text)
// Just verify the method works without specific assertions
expect(result).toBeInstanceOf(Set)
expect(result.size).toBeGreaterThanOrEqual(0)
})
test('should direct extract methods work with actual regex patterns', () => {
// Create text with secrets
const secretsText = 'steps:\n - run: echo "${{ secrets.API_KEY }}"\n - run: echo "${{ secrets.TOKEN }}"'
// Call extractSecrets directly
const secretsResult = report.extractSecrets(secretsText)
expect(secretsResult).toBeInstanceOf(Set)
// Create text with vars
const varsText = 'steps:\n - run: echo "${{ vars.CONFIG }}"\n - run: echo "${{ vars.ENV }}"'
// Call extractVars directly
const varsResult = report.extractVars(varsText)
expect(varsResult).toBeInstanceOf(Set)
// Create text with uses
const usesText = 'steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3'
// Call extractUses directly
const usesResult = report.extractUses(usesText)
expect(usesResult).toBeInstanceOf(Set)
})
test('should extract YAML key values from nested objects', () => {
const yaml = {
jobs: {
test: {
'runs-on': 'ubuntu-latest',
},
build: {
'runs-on': 'windows-latest',
},
deploy: {
steps: [
{'runs-on': 'invalid-location'}, // Should be ignored since runs-on should be at job level
],
},
},
}
const results = report.extractYamlKeyValues(yaml, 'runs-on', 'runsOn', [])
// Should find the two valid runs-on values
expect(results).toHaveLength(2)
expect(results).toContain('ubuntu-latest')
expect(results).toContain('windows-latest')
})
test('should process individual workflow job properties', () => {
// Test extracting job properties directly
const yaml = {
jobs: {
build: {
'runs-on': 'ubuntu-latest',
permissions: {
contents: 'read',
issues: 'write',
},
steps: [{run: 'npm ci'}, {uses: 'actions/checkout@v3'}],
},
},
}
// Test extractRunsOn
const runsOnResults = report.extractRunsOn(yaml)
expect(runsOnResults).toContain('ubuntu-latest')
// Test extractPermissions
const permissionsResults = report.extractPermissions(yaml)
expect(permissionsResults.length).toBeGreaterThan(0)
})
test('should create workflow data object with correct options', () => {
// TODO: Implement test logic
})
})
/**
* Test report generation
*/
describe('report generation', () => {
test('should create report from repository data', async () => {
// Mock repository data with workflows
const mockRepo = {
nwo: 'test-owner/test-repo',
owner: 'test-owner',
name: 'test-repo',
workflows: [
{
path: '.github/workflows/ci.yml',
language: 'YAML',
yaml: {
name: 'CI Workflow',
on: {push: {}, pull_request: {}},
jobs: {
build: {
'runs-on': 'ubuntu-latest',
steps: [{uses: 'actions/checkout@v3'}, {uses: 'actions/setup-node@v3'}],
},
},
},
text: 'name: CI Workflow\non:\n push:\n pull_request:\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3',
state: 'active',
created_at: '2023-01-01T00:00:00Z',
updated_at: '2023-02-01T00:00:00Z',
last_run_at: '2023-03-01T00:00:00Z',
node_id: 'node123',
},
],
}
// Mock extractRepositoriesFromData to return our test repo
jest.spyOn(report, 'extractRepositoriesFromData').mockReturnValueOnce([mockRepo])
// Mock createWorkflowDataObject to return basic workflow data
jest.spyOn(report, 'createWorkflowDataObject').mockImplementation((wf, repo) => ({
id: wf.node_id,
owner: repo.owner,
repo: repo.name,
name: wf.yaml.name,
workflow: wf.path,
state: wf.state,
created_at: wf.created_at,
updated_at: wf.updated_at,
last_run_at: wf.last_run_at,
listeners: new Set(),
permissions: new Set(),
runsOn: new Set(),
secrets: new Set(),
vars: new Set(),
uses: new Set(),
}))
// Mock extractWorkflowContents to populate workflow fields
jest.spyOn(report, 'extractWorkflowContents').mockImplementation(workflowData => {
workflowData.listeners.add('push')
workflowData.listeners.add('pull_request')
workflowData.runsOn.add('ubuntu-latest')
workflowData.uses.add('actions/checkout@v3')
workflowData.uses.add('actions/setup-node@v3')
return workflowData
})
// Call createReport
const result = await report.createReport({repositories: [mockRepo]})
// Verify the report data was created correctly
expect(result).toHaveLength(1)
expect(result[0]).toEqual(
expect.objectContaining({
id: 'node123',
owner: 'test-owner',
repo: 'test-repo',
name: 'CI Workflow',
workflow: '.github/workflows/ci.yml',
}),
)
// Verify the workflow data was populated
expect(result[0].listeners.size).toBe(2)
expect(result[0].listeners.has('push')).toBe(true)
expect(result[0].listeners.has('pull_request')).toBe(true)
expect(result[0].runsOn.has('ubuntu-latest')).toBe(true)
expect(result[0].uses.has('actions/checkout@v3')).toBe(true)
expect(result[0].uses.has('actions/setup-node@v3')).toBe(true)
})
test('should handle empty data in createReport', async () => {
// Mock extractRepositoriesFromData to return empty array
jest.spyOn(report, 'extractRepositoriesFromData').mockReturnValueOnce([])
const result = await report.createReport({})
expect(result).toEqual([])
expect(mockLogger.error).toHaveBeenCalledWith(expect.stringContaining('✖'), 'Stopping report generation.')
})
test('should process workflow at lower levels', () => {
// Test with complex workflow steps
const mockRepo = {
owner: 'test-owner',
name: 'test-repo',
nwo: 'test-owner/test-repo',
workflows: [],
}
const mockWorkflows = [
{
path: '.github/workflows/test.yml',
yaml: {name: 'Test'},
text: 'steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3',
language: 'YAML',
state: 'active',
created_at: '2023-01-01',
updated_at: '2023-01-02',
last_run_at: '2023-01-03',
node_id: 'node123',
},
]
// Test reporting on workflow steps
const reportData = []
const reportTotalCounts = {
repos: 0,
workflows: 0,
listeners: 0,
permissions: 0,
runsOn: 0,
secrets: 0,
uses: 0,
vars: 0,
}
// Mock intermediate methods to focus on processRepositoryWorkflows
jest.spyOn(report, 'processWorkflow').mockImplementation(wf => {
reportTotalCounts.workflows++
reportTotalCounts.uses += 2 // Simulating two uses values found
return {
id: wf.node_id,
uses: new Set(['actions/checkout@v3', 'actions/setup-node@v3']),
}
})
// Test the method
report.processRepositoryWorkflows({...mockRepo, workflows: mockWorkflows}, reportData, reportTotalCounts)
// Verify counts updated
expect(reportTotalCounts.repos).toBe(1)
expect(reportTotalCounts.workflows).toBe(1)
expect(reportTotalCounts.uses).toBe(2)
})
})
/**
* Test report saving
*/
describe('report saving', () => {
test('should handle saveReports with basic functionality', async () => {
// TODO: Implement test logic
})
test('should create output directory when it does not exist', async () => {
// TODO: Implement test logic
})
test('should call save methods depending on uniqueFlag value', async () => {
// TODO: Implement test logic
})
})
})