@@ -101,7 +101,7 @@ describe('Standalone Scanner Strategy', () => {
101
101
null ,
102
102
) ;
103
103
} ) ;
104
- it ( 'should return keys names only' , async ( ) => {
104
+ it ( 'should return keys names and type only' , async ( ) => {
105
105
const args = {
106
106
...getKeysDto , type : 'string' , match : 'pattern*' , keysInfo : false ,
107
107
} ;
@@ -126,7 +126,7 @@ describe('Standalone Scanner Strategy', () => {
126
126
...mockNodeEmptyResult ,
127
127
total : 1 ,
128
128
scanned : getKeysDto . count ,
129
- keys : [ { name : getKeyInfoResponse . name } ] ,
129
+ keys : [ { name : getKeyInfoResponse . name , type : getKeyInfoResponse . type } ] ,
130
130
} ,
131
131
] ) ;
132
132
} ) ;
@@ -384,7 +384,7 @@ describe('Standalone Scanner Strategy', () => {
384
384
. fn ( )
385
385
. mockResolvedValue ( [ getKeyInfoResponse ] ) ;
386
386
387
- const result = await strategy . getKeys ( mockBrowserClientMetadata , dto ) ;
387
+ const result = await strategy . getKeys ( mockBrowserClientMetadata , dto , dto . type ) ;
388
388
389
389
expect ( result ) . toEqual ( [
390
390
{
@@ -394,9 +394,11 @@ describe('Standalone Scanner Strategy', () => {
394
394
keys : [ getKeyInfoResponse ] ,
395
395
} ,
396
396
] ) ;
397
- expect ( strategy . getKeysInfo ) . toHaveBeenCalledWith ( nodeClient , [
398
- Buffer . from ( key ) ,
399
- ] ) ;
397
+ expect ( strategy . getKeysInfo ) . toHaveBeenCalledWith (
398
+ nodeClient ,
399
+ [ Buffer . from ( key ) ] ,
400
+ dto . type ,
401
+ ) ;
400
402
expect ( strategy . scan ) . not . toHaveBeenCalled ( ) ;
401
403
} ) ;
402
404
it ( 'should find exact key when match is escaped glob patter' , async ( ) => {
@@ -406,7 +408,7 @@ describe('Standalone Scanner Strategy', () => {
406
408
. fn ( )
407
409
. mockResolvedValue ( [ { ...getKeyInfoResponse , name : mockSearchPattern } ] ) ;
408
410
409
- const result = await strategy . getKeys ( mockBrowserClientMetadata , dto ) ;
411
+ const result = await strategy . getKeys ( mockBrowserClientMetadata , dto , dto . type ) ;
410
412
411
413
expect ( result ) . toEqual ( [
412
414
{
@@ -416,7 +418,11 @@ describe('Standalone Scanner Strategy', () => {
416
418
keys : [ { ...getKeyInfoResponse , name : mockSearchPattern } ] ,
417
419
} ,
418
420
] ) ;
419
- expect ( strategy . getKeysInfo ) . toHaveBeenCalledWith ( nodeClient , [ Buffer . from ( mockSearchPattern ) ] ) ;
421
+ expect ( strategy . getKeysInfo ) . toHaveBeenCalledWith (
422
+ nodeClient ,
423
+ [ Buffer . from ( mockSearchPattern ) ] ,
424
+ dto . type ,
425
+ ) ;
420
426
expect ( strategy . scan ) . not . toHaveBeenCalled ( ) ;
421
427
} ) ;
422
428
it ( 'should find exact key with correct type' , async ( ) => {
0 commit comments