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

doc(docs.mockFunctions): use SAME JS module system #15486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dancer1325
Copy link

@dancer1325 dancer1325 commented Feb 3, 2025

Summary

  • In Using a mock function, you can see that
    • in js title="forEach.test.js" , that require is used == CommonJS
    • in js title="forEach.js", that export is used == ES
  • ⚠️That's why lot of pitfalls you will get, mixin them ⚠️
  • Solution:
    • align to use CommonJS in both files defined

Test plan

  • Create both 2 files
  • Create the minimum set up to make jest work -- see gettingStarted --
  • Run it to test
    image

Copy link

linux-foundation-easycla bot commented Feb 3, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Feb 3, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e416d58
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/67a0d697c33f0d0008cc437a
😎 Deploy Preview https://deploy-preview-15486--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.

@dancer1325
Copy link
Author

maybe @SimenB ?

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.

1 participant