fix: ensure 'its' function type excludes null and undefined (#28872)
This fix addresses an issue where the 'its' function could return null or undefined, causing unexpected behavior in certain scenarios. The change introduces a more robust type check to ensure that the returned value is always non-null and non-undefined.
- Closes https://github.com/cypress-io/cypress/issues/28872
Additional details
The change was necessary to address an issue where the 'its' function could potentially return null or undefined. This behavior led to unexpected outcomes in certain scenarios. The fix ensures that the 'its' function consistently returns a value that is non-null and non-undefined. The affected area is the 'its' function, specifically its type signature. Prior to the fix, the function had the potential to return null or undefined. This change impacts any usage of the 'its' function, ensuring that users can rely on a non-null and non-undefined result. The implementation involves a modification to the 'its' function to include a more robust type check. This check ensures that the returned value is guaranteed to be non-null and non-undefined.
Steps to test
How has the user experience changed?
PR Tasks
- [na] Have tests been added/updated?
- [na] Has a PR for user-facing changes been opened in
cypress-documentation? - [na] Have API changes been updated in the
type definitions?
- Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
@AkshatHotCode Will you have time to address the lint errors? We'll have to close this PR otherwise.
I will address this.
@jennifer-shehane Changes are being made, apologies for the delay.
@AkshatHotCode Looking back at this, sorry for the delay
Released in 13.8.1.
This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v13.8.1, please open a new issue.