Skip to content

feat(assertions): allow asserting JS undefined in ToHaveJSPropertyAsync - #3346

Closed
Darío Kondratiuk (kblok) wants to merge 1 commit into
microsoft:mainfrom
kblok:feat/tohavejsproperty-undefined
Closed

feat(assertions): allow asserting JS undefined in ToHaveJSPropertyAsync#3346
Darío Kondratiuk (kblok) wants to merge 1 commit into
microsoft:mainfrom
kblok:feat/tohavejsproperty-undefined

Conversation

@kblok

Copy link
Copy Markdown
Contributor

Summary

  • Add JSUndefined.Value so ToHaveJSPropertyAsync can assert a JavaScript undefined property, matching the JS matcher.
  • Serialization is isolated to this assertion; EvaluateAsync still sends C# null as JS null.

Fixes #3299

Made with Cursor

.NET has no undefined value, so ToHaveJSPropertyAsync could not match the JS matcher. Introduce JSUndefined.Value as a sentinel used only by this assertion, leaving Evaluate serialization unchanged.

Fixes microsoft#3299

Co-authored-by: Cursor <cursoragent@cursor.com>
@kblok

Copy link
Copy Markdown
Contributor Author

Opened on the kblok fork instead: kblok#3

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.

[Feature]: Represent ToHaveJSPropertyAsync for JS value undefined

1 participant