Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
docs(jest-mock): Add example for ES6 modules #8550
Add an example on the
I haven't found information on how to do this in the Jest documentation. I believe this information should be available.
The issue is that compared to mocking out CommonJS modules, ES6 modules require the
This is purely a documentation change, so I have not touched the tests for the functional code in Jest.
A similar test to the example code passes tests.
If I'm missing anything please let me know and I will fix it. In particular I wasn't sure what to do with the docs / versioned docs. Currently I have just edited the docs/JestObjectAPI.md file).
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.
If you have received this in error or have any questions, please contact us at firstname.lastname@example.org. Thanks!
@@ Coverage Diff @@ ## master #8550 +/- ## ======================================= Coverage 60.57% 60.57% ======================================= Files 269 269 Lines 11054 11054 Branches 2696 2696 ======================================= Hits 6696 6696 Misses 3772 3772 Partials 586 586
* docs(JestObjectAPI jest-mock): Add example for ES6 modules Issue facebook#8543 * chore(CHANGELOG): Update CHANGELOG * docs(JestObjectAPI jest-mock): Add explanation for __esModule: true Issue facebook#8543 * docs(JestObjectAPI jest-mock): Update versioned_docs Issue facebook#8543 * Revert "docs(JestObjectAPI jest-mock): Update versioned_docs" This reverts commit ba17c08. Updating the versioned_docs for version 24.6 is not necessary as we can update an earlier version and the changes will propagate to the new version. * docs(JestObjectAPI jest-mock): Update previous versioned_docs The example for using __esModule: true is also relevant for those versions, so it should be present.