Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow templating of null and undefined in a jest each key path template #14831

Merged

Conversation

Germandrummer92
Copy link
Contributor

Summary

See newly added e2e tests, currently jest crashed with:

 ● allows templating "$array.length"

    Cannot convert undefined or null to object

       7 | });

when adding a nested keypath as a template in a null or undefined object. Instead we just early-exit out of interplation in those cases.

Test plan

  • yarn test yarn constraints

Copy link

linux-foundation-easycla bot commented Jan 4, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Jan 4, 2024

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6ae80f6
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/65eb3067294bde000872d19b
😎 Deploy Preview https://deploy-preview-14831--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Germandrummer92 Germandrummer92 force-pushed the allow-templating-null-or-undefined branch from 5eb4ab8 to 6af8f19 Compare February 6, 2024 14:00
@Germandrummer92
Copy link
Contributor Author

hmm, not sure why the tests are now failing 😢

@Germandrummer92 Germandrummer92 force-pushed the allow-templating-null-or-undefined branch from 6af8f19 to c67c4bf Compare March 5, 2024 17:56
@SimenB
Copy link
Member

SimenB commented Mar 8, 2024

The one failing test is a known one

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks! just a minor change needed to actually run the test

e2e/each/__tests__/eachTemplate.test.js Show resolved Hide resolved
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks!

@SimenB SimenB merged commit 89d6b08 into jestjs:main Mar 16, 2024
72 of 73 checks passed
@Germandrummer92 Germandrummer92 deleted the allow-templating-null-or-undefined branch March 19, 2024 10:45
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
@SimenB
Copy link
Member

SimenB commented May 12, 2024

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants