@@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'
33
44import { SocketSdk } from '../dist/index'
55
6- import type { EntitlementsResponse } from '../dist/index'
6+ import type { Entitlement , EntitlementsResponse } from '../dist/index'
77
88describe ( 'Entitlements API' , ( ) => {
99 let client : SocketSdk
@@ -271,7 +271,7 @@ describe('Entitlements API', () => {
271271 } )
272272
273273 it ( 'should handle large number of entitlements' , async ( ) => {
274- const items = Array . from ( { length : 100 } , ( _ , i ) => ( {
274+ const items = Array . from ( { length : 100 } , ( _ : unknown , i : number ) => ( {
275275 key : `product-${ i } ` ,
276276 // Every other one enabled
277277 enabled : i % 2 === 0 ,
@@ -363,13 +363,15 @@ describe('Entitlements API', () => {
363363 . times ( 5 )
364364 . reply ( 200 , mockResponse )
365365
366- const promises = Array . from ( { length : 5 } , ( ) =>
367- client . getEnabledEntitlements ( 'concurrent-org' ) ,
366+ const promises = Array . from (
367+ { length : 5 } ,
368+ ( ) : Promise < string [ ] > =>
369+ client . getEnabledEntitlements ( 'concurrent-org' ) ,
368370 )
369371
370372 const results = await Promise . all ( promises )
371373
372- results . forEach ( result => {
374+ results . forEach ( ( result : string [ ] ) => {
373375 expect ( result ) . toEqual ( [ 'firewall' ] )
374376 } )
375377 } )
@@ -383,13 +385,15 @@ describe('Entitlements API', () => {
383385 } )
384386 }
385387
386- const promises = Array . from ( { length : 10 } , ( _ , i ) =>
387- client . getEnabledEntitlements ( `org-${ i } ` ) ,
388+ const promises = Array . from (
389+ { length : 10 } ,
390+ ( _ : unknown , i : number ) : Promise < string [ ] > =>
391+ client . getEnabledEntitlements ( `org-${ i } ` ) ,
388392 )
389393
390394 const results = await Promise . all ( promises )
391395
392- results . forEach ( ( result , i ) => {
396+ results . forEach ( ( result : string [ ] , i : number ) => {
393397 expect ( result ) . toEqual ( [ `product-${ i } ` ] )
394398 } )
395399 } )
@@ -411,7 +415,7 @@ describe('Entitlements API', () => {
411415 const entitlements = await client . getEntitlements ( 'type-test-org' )
412416
413417 // Verify TypeScript types are preserved
414- entitlements . forEach ( entitlement => {
418+ entitlements . forEach ( ( entitlement : Entitlement ) => {
415419 expect ( typeof entitlement . key ) . toBe ( 'string' )
416420 expect ( typeof entitlement . enabled ) . toBe ( 'boolean' )
417421 } )
0 commit comments