Skip to content

Add tests for getPropertyDescriptor - #377

Open
Ultroncn wants to merge 1 commit into
github:mainfrom
Ultroncn:test/get-property-descriptor-coverage
Open

Ultroncn wants to merge 1 commit into
github:mainfrom
Ultroncn:test/get-property-descriptor-coverage

Conversation

@Ultroncn

Copy link
Copy Markdown

Hi team, thank you for this wonderful project! I noticed that getPropertyDescriptor (used by mark.ts to read accessors) has no test coverage, so I added a small test file for it:

  • own property descriptor (value/writable/enumerable/configurable)
  • descriptor found up the prototype chain
  • accessor (getter) descriptor
  • symbol keys
  • undefined for a missing key (and found on Object.prototype, e.g. toString)

I verified the assertions against the current implementation in Node (all 5 groups pass), and tsc --noEmit and eslint are both clean. I could not run the full npm test suite locally because this machine has no usable Chrome for web-test-runner, so I would appreciate CI running the browser tests. Please let me know if anything needs adjusting!

@Ultroncn
Ultroncn requested a review from a team as a code owner November 17, 2026 02:50
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, and the change is narrowly focused on expanding descriptor behavior coverage across the documented cases.

No open issues 🎉

What changed in this PR

Adds browser tests for getPropertyDescriptor, covering own properties, inherited descriptors, accessors, symbol keys, and missing properties.

Changes:

  • Tests complete descriptors for own data properties.
  • Covers prototype-chain lookup, getter descriptors, and symbol keys.
  • Verifies missing keys return undefined while inherited Object.prototype properties are found.
File Description
test/​get-property-descriptor.ts Adds comprehensive tests for getPropertyDescriptor across own properties, prototype-chain descriptors, accessors, symbols, and missing keys.

Review effort: Lite (adaptive)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants