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

Add example to jest.requireActual #8482

Merged
merged 5 commits into from
May 22, 2019
Merged

Add example to jest.requireActual #8482

merged 5 commits into from
May 22, 2019

Conversation

sandrina-p
Copy link
Contributor

Summary

I've spent 1 hour looking how to proper use jest.requireActual until I found this comment: #936 (comment)

I think it's too good to not be in the docs.

Test plan

Was just a quick change on the .md file. This is how it looks now:
image

@facebook-github-bot
Copy link
Contributor

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 [email protected]. Thanks!

sandrina-p added a commit to sandrina-p/jest that referenced this pull request May 22, 2019
sandrina-p added a commit to sandrina-p/jest that referenced this pull request May 22, 2019
docs/JestObjectAPI.md Outdated 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! Could you add this to the versioned docs as well?

image

Also to the examples in the typing: https://github.com/facebook/jest/blob/74f6faf2c87e8afaf56486378590e52c0089ef5a/packages/jest-environment/src/index.ts#L137-L141

@sandrina-p
Copy link
Contributor Author

@simen I've updated the version docs but I didn't understand how to update the example in the typing :x

@SimenB
Copy link
Member

SimenB commented May 22, 2019

I didn't understand how to update the example in the typing :x

You can see how an example can be added to tsdoc here: https://github.com/sindresorhus/execa/blob/5766371212faa242f0070e9db91b72c6a3414580/index.d.ts#L299-L331

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@codecov-io
Copy link

codecov-io commented May 22, 2019

Codecov Report

Merging #8482 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8482   +/-   ##
=======================================
  Coverage   62.25%   62.25%           
=======================================
  Files         266      266           
  Lines       10746    10746           
  Branches     2625     2626    +1     
=======================================
  Hits         6690     6690           
  Misses       3471     3471           
  Partials      585      585

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74f6faf...d3efbcd. Read the comment docs.

@sandrina-p
Copy link
Contributor Author

@SimenB done, can you confirm?

@SimenB SimenB merged commit c24934c into jestjs:master May 22, 2019
@SimenB
Copy link
Member

SimenB commented May 22, 2019

Thanks!

@sandrina-p
Copy link
Contributor Author

Great, now how can I know when will it be published to the website?

@SimenB
Copy link
Member

SimenB commented May 22, 2019

When https://circleci.com/gh/facebook/jest/64295 completes

```js
jest.mock('../myModule', () => {
// Require the original module to not be mocked...
const originalModule = jest.requireActual(moduleName);
Copy link
Contributor

@solimant solimant Jul 7, 2020

Choose a reason for hiding this comment

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

What is moduleName? Is it '../myModule'? Is it 'myModule'? Should be clarified.

Copy link
Member

Choose a reason for hiding this comment

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

'../myModule'. Wanna send a PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Yes, happy to.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done -> #10255

@github-actions
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 May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants