@@ -213,8 +213,8 @@ describe('Minimum Release Age Functionality', () => {
213
213
const buddy = new Buddy ( config , testDir )
214
214
215
215
// Mock the registry client's meetsMinimumReleaseAge method
216
- const originalMethod = buddy . registryClient . meetsMinimumReleaseAge
217
- buddy . registryClient . meetsMinimumReleaseAge = mock ( async ( packageName : string , _version : string , _dependencyType ?: string ) => {
216
+ const originalMethod = ( buddy as any ) . registryClient . meetsMinimumReleaseAge
217
+ ; ( buddy as any ) . registryClient . meetsMinimumReleaseAge = mock ( async ( packageName : string , _version : string , _dependencyType ?: string ) => {
218
218
// Simulate different packages with different ages
219
219
if ( packageName === 'old-package' )
220
220
return true
@@ -253,14 +253,14 @@ describe('Minimum Release Age Functionality', () => {
253
253
]
254
254
255
255
// Call the private method using bracket notation
256
- const filteredUpdates = await buddy . filterUpdatesByMinimumReleaseAge ( mockUpdates )
256
+ const filteredUpdates = await ( buddy as any ) . filterUpdatesByMinimumReleaseAge ( mockUpdates )
257
257
258
258
// Should only include old-package and trusted-package
259
259
expect ( filteredUpdates ) . toHaveLength ( 2 )
260
- expect ( filteredUpdates . map ( u => u . name ) ) . toEqual ( [ 'old-package' , 'trusted-package' ] )
260
+ expect ( filteredUpdates . map ( ( u : PackageUpdate ) => u . name ) ) . toEqual ( [ 'old-package' , 'trusted-package' ] )
261
261
262
262
// Restore original method
263
- buddy . registryClient . meetsMinimumReleaseAge = originalMethod
263
+ ; ( buddy as any ) . registryClient . meetsMinimumReleaseAge = originalMethod
264
264
} )
265
265
266
266
it ( 'should return all updates when minimumReleaseAge is 0' , async ( ) => {
@@ -292,7 +292,7 @@ describe('Minimum Release Age Functionality', () => {
292
292
} ,
293
293
]
294
294
295
- const filteredUpdates = await buddy . filterUpdatesByMinimumReleaseAge ( mockUpdates )
295
+ const filteredUpdates = await ( buddy as any ) . filterUpdatesByMinimumReleaseAge ( mockUpdates )
296
296
297
297
// Should return all updates when disabled
298
298
expect ( filteredUpdates ) . toHaveLength ( 2 )
@@ -310,7 +310,7 @@ describe('Minimum Release Age Functionality', () => {
310
310
const buddy = new Buddy ( config , testDir )
311
311
312
312
// Mock the registry client to simulate different behaviors for different types
313
- buddy . registryClient . meetsMinimumReleaseAge = mock ( async ( packageName : string , version : string , dependencyType ?: string ) => {
313
+ ; ( buddy as any ) . registryClient . meetsMinimumReleaseAge = mock ( async ( packageName : string , version : string , dependencyType ?: string ) => {
314
314
// Simulate that npm packages are too new, but GitHub Actions are old enough
315
315
if ( dependencyType === 'dependencies' )
316
316
return false
@@ -348,11 +348,11 @@ describe('Minimum Release Age Functionality', () => {
348
348
} ,
349
349
]
350
350
351
- const filteredUpdates = await buddy . filterUpdatesByMinimumReleaseAge ( mockUpdates )
351
+ const filteredUpdates = await ( buddy as any ) . filterUpdatesByMinimumReleaseAge ( mockUpdates )
352
352
353
353
// Should only include GitHub Actions and Composer packages
354
354
expect ( filteredUpdates ) . toHaveLength ( 2 )
355
- expect ( filteredUpdates . map ( u => u . name ) ) . toEqual ( [ 'actions/checkout' , 'laravel/framework' ] )
355
+ expect ( filteredUpdates . map ( ( u : PackageUpdate ) => u . name ) ) . toEqual ( [ 'actions/checkout' , 'laravel/framework' ] )
356
356
} )
357
357
} )
358
358
@@ -381,7 +381,7 @@ describe('Minimum Release Age Functionality', () => {
381
381
const buddy = new Buddy ( config , testDir )
382
382
383
383
// Mock the registry client methods to avoid actual network calls
384
- buddy . registryClient . getOutdatedPackages = mock ( async ( ) => [
384
+ ; ( buddy as any ) . registryClient . getOutdatedPackages = mock ( async ( ) => [
385
385
{
386
386
name : 'react' ,
387
387
currentVersion : '17.0.0' ,
@@ -401,12 +401,12 @@ describe('Minimum Release Age Functionality', () => {
401
401
] )
402
402
403
403
// Mock other update checking methods to return empty arrays
404
- buddy . checkDependencyFilesForUpdates = mock ( async ( ) => [ ] )
405
- buddy . checkGitHubActionsForUpdates = mock ( async ( ) => [ ] )
406
- buddy . checkDockerfilesForUpdates = mock ( async ( ) => [ ] )
404
+ ; ( buddy as any ) . checkDependencyFilesForUpdates = mock ( async ( ) => [ ] )
405
+ ; ( buddy as any ) . checkGitHubActionsForUpdates = mock ( async ( ) => [ ] )
406
+ ; ( buddy as any ) . checkDockerfilesForUpdates = mock ( async ( ) => [ ] )
407
407
408
408
// Mock minimum release age checking
409
- buddy . registryClient . meetsMinimumReleaseAge = mock ( async ( packageName : string ) => {
409
+ ; ( buddy as any ) . registryClient . meetsMinimumReleaseAge = mock ( async ( packageName : string ) => {
410
410
// Only allow typescript (simulate react being too new)
411
411
return packageName === 'typescript'
412
412
} )
0 commit comments