Skip to content

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

Merged
SimenB merged 5 commits into
jestjs:mainfrom
Germandrummer92:allow-templating-null-or-undefined
Mar 16, 2024
Merged

SimenB merged 5 commits into
jestjs:mainfrom
Germandrummer92:allow-templating-null-or-undefined

Conversation

@Germandrummer92

Copy link
Copy Markdown
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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jan 4, 2024 •

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@netlify

netlify Bot commented Jan 4, 2024 •

Copy link
Copy Markdown

✅ 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
Copy Markdown
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

SimenB commented Mar 8, 2024

Copy link
Copy Markdown
Member

The one failing test is a known one

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

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

Comment thread e2e/each/__tests__/eachTemplate.test.js

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

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
@Germandrummer92
Germandrummer92 deleted the allow-templating-null-or-undefined branch March 19, 2024 10:45
@github-actions

Copy link
Copy Markdown

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

SimenB commented May 12, 2024

Copy link
Copy Markdown
Member

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