Skip to content

Commit 600fd1e

Browse files
committed
test: update tests to verify warning logging for circular references
1 parent 29e4832 commit 600fd1e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/utils/secretReferencing.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,20 @@ describe('Secret Referencing Utils', () => {
277277
version: 1
278278
});
279279

280-
await expect(resolveSecretReferences(
280+
const consoleSpy = jest.spyOn(console, 'warn').mockImplementation();
281+
282+
const result = await resolveSecretReferences(
281283
'${SECRET_KEY}',
282284
'dev',
283285
'/',
284286
mockFetcher,
285287
null,
286288
cache
287-
)).rejects.toThrow('Circular reference detected');
289+
);
290+
291+
expect(result).toBe('${SECRET_KEY}');
292+
expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining('Circular reference detected'));
293+
consoleSpy.mockRestore();
288294
});
289295

290296
it('should handle multiple references in a single value', async () => {

0 commit comments

Comments
 (0)