diff --git a/tests/isDeepRef.spec.ts b/tests/isDeepRef.spec.ts index 7fc9a5b16..934c3c97d 100644 --- a/tests/isDeepRef.spec.ts +++ b/tests/isDeepRef.spec.ts @@ -67,4 +67,16 @@ describe('isDeepRef', () => { expect(isDeepRef(item)).toBe(true) }) + it('should return false for an object with a dynamic circular reference', () => { + const testObject = {} + Object.defineProperty(testObject, 'circularReference', { + get: function () { + delete this.circularReference + this.circularReference = testObject + return this.circularReference + } + }) + expect(() => isDeepRef(testObject)).not.toThrow() + expect(isDeepRef(testObject)).toBe(false) + }) })