Sha256: 5a6ecca5783da5f717f09d7ed0893eabab18f70ebfa4f280dffafe619dc6a47b
Contents?: true
Size: 793 Bytes
Versions: 26
Compression:
Stored size: 793 Bytes
Contents
import { it, expect } from 'vitest' import { findPropertySource } from './findPropertySource' it('returns the source for objects without prototypes', () => { const obj = Object.create(null) obj.test = undefined const source = findPropertySource(obj, 'test') expect(source).toBe(obj) }) it('returns the source for objects with prototypes', () => { const prototype = Object.create(null) prototype.test = undefined const obj = Object.create(prototype) const source = findPropertySource(obj, 'test') expect(source).toBe(prototype) }) it('returns null if the prototype chain does not contain the property', () => { const prototype = Object.create(null) const obj = Object.create(prototype) const source = findPropertySource(obj, 'test') expect(source).toBeNull() })
Version data entries
26 entries across 26 versions & 1 rubygems