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

[babel-plugin-jest-hoist] Fix MockNativeMethods access in react-native #6505

Merged
merged 6 commits into from
Jun 20, 2018
Merged

[babel-plugin-jest-hoist] Fix MockNativeMethods access in react-native #6505

merged 6 commits into from
Jun 20, 2018

Conversation

timwangdev
Copy link
Contributor

@timwangdev timwangdev commented Jun 20, 2018

@thymikee
Copy link
Collaborator

Might adding a changelog and updating an e2e test?

@@ -110,7 +110,7 @@ FUNCTIONS.mock = args => {
if (!found) {
invariant(
(scope.hasGlobal(name) && WHITELISTED_IDENTIFIERS[name]) ||
/^mock/.test(name) ||
/^[Mm]ock/.test(name) ||
Copy link
Member

Choose a reason for hiding this comment

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

/^mock/i? MOCK_THING should be fine as well, IMO.

Copy link
Member

Choose a reason for hiding this comment

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

Should also update the message on line 126

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

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.

See inline comments

@@ -71,7 +71,7 @@ const WHITELISTED_IDENTIFIERS = {
};
Object.keys(global).forEach(name => (WHITELISTED_IDENTIFIERS[name] = true));

const JEST_GLOBAL = {name: 'jest'};
const JEST_GLOBAL = { name: 'jest' };
Copy link
Member

Choose a reason for hiding this comment

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

I think your IDE autoformatted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codecov-io
Copy link

codecov-io commented Jun 20, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6505   +/-   ##
=======================================
  Coverage   63.48%   63.48%           
=======================================
  Files         227      227           
  Lines        8697     8697           
  Branches        3        3           
=======================================
  Hits         5521     5521           
  Misses       3175     3175           
  Partials        1        1

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 4805134...366cb5b. Read the comment docs.

@cpojer cpojer merged commit 49d7bbf into jestjs:master Jun 20, 2018
@timwangdev timwangdev deleted the patch-1 branch June 20, 2018 18:19
@macrozone
Copy link

are we able to install that? can't run tests under react-native 0.56 without that :-/

refering to a commit-url in package.json does not work unfortunatly

@emilkarl
Copy link

When will this be released?

@thymikee
Copy link
Collaborator

cc @mjesun @SimenB, we should be good to make a minor release

@SimenB
Copy link
Member

SimenB commented Jun 25, 2018

I'd like for #6523 to land first (#6498 would also be nice), but I agree this should see a release

@mjesun
Copy link
Contributor

mjesun commented Jun 25, 2018

👌🏻 Let me know when you want the release to be done and we'll make it 🙂

@SimenB
Copy link
Member

SimenB commented Jun 25, 2018

You can land #6523 and do it? 😀

@mjesun
Copy link
Contributor

mjesun commented Jun 25, 2018

#6523 is b0rken, is it OK to land?

@SimenB
Copy link
Member

SimenB commented Jun 25, 2018

Yeah, CI was fixed after that was opened in #6532

@mjesun
Copy link
Contributor

mjesun commented Jun 25, 2018

Roger that!

calebeby referenced this pull request in Pigmice2733/scouting-frontend Jun 30, 2018
This Pull Request updates dependency [jest](https://github.com/facebook/jest) from `v23.1.0` to `v23.2.0`



<details>
<summary>Release Notes</summary>

### [`v23.2.0`](https://github.com/facebook/jest/blob/master/CHANGELOG.md#&#8203;2320)
[Compare Source](jestjs/jest@v23.1.0...v23.2.0)
##### Features

- `[jest-each]` Add support for keyPaths in test titles ([#&#8203;6457](`https://github.com/facebook/jest/pull/6457`))
- `[jest-cli]` Add `jest --init` option that generates a basic configuration file with a short description for each option ([#&#8203;6442](`https://github.com/facebook/jest/pull/6442`))
- `[jest.retryTimes]` Add `jest.retryTimes()` option that allows failed tests to be retried n-times when using jest-circus. ([#&#8203;6498](`https://github.com/facebook/jest/pull/6498`))
##### Fixes

- `[jest-cli]` Add check to make sure one or more tests have run before notifying when using `--notify` ([#&#8203;6495](`https://github.com/facebook/jest/pull/6495`))
- `[jest-cli]` Pass `globalConfig` as a parameter to `globalSetup` and `globalTeardown` functions ([#&#8203;6486](`https://github.com/facebook/jest/pull/6486`))
- `[jest-config]` Add missing options to the `defaults` object ([#&#8203;6428](`https://github.com/facebook/jest/pull/6428`))
- `[expect]` Using symbolic property names in arrays no longer causes the `toEqual` matcher to fail ([#&#8203;6391](`https://github.com/facebook/jest/pull/6391`))
- `[expect]` `toEqual` no longer tries to compare non-enumerable symbolic properties, to be consistent with non-symbolic properties. ([#&#8203;6398](`https://github.com/facebook/jest/pull/6398`))
- `[jest-util]` `console.timeEnd` now properly log elapsed time in milliseconds. ([#&#8203;6456](`https://github.com/facebook/jest/pull/6456`))
- `[jest-mock]` Fix `MockNativeMethods` access in react-native `jest.mock()` ([#&#8203;6505](`https://github.com/facebook/jest/pull/6505`))
##### Chore & Maintenance

- `[docs]` Add jest-each docs for 1 dimensional arrays ([#&#8203;6444](`https://github.com/facebook/jest/pull/6444`/files))

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
robertjd pushed a commit to okta/okta-oidc-js that referenced this pull request Jul 9, 2018
Tests have started failing (see [Build #699](https://travis-ci.org/okta/okta-oidc-js/builds/401943311)).

I tried upgrading the jest and/or the babel plugins, per these threads:

facebook/react-native#19859
jestjs/jest#6505

But I didn't have any luck.  Locking to the 0.55 series of react-ntaive does seeem to fix this problem
robertdamphousse-okta pushed a commit to okta/okta-oidc-js that referenced this pull request Jul 10, 2018
Tests have started failing (see [Build #699](https://travis-ci.org/okta/okta-oidc-js/builds/401943311)).

I tried upgrading the jest and/or the babel plugins, per these threads:

facebook/react-native#19859
jestjs/jest#6505

But I didn't have any luck.  Locking to the 0.55 series of react-native does seem to fix this problem
@evanjmg
Copy link

evanjmg commented Jul 22, 2018

Is this fixed? I'm still getting the error with Jest 23.4.1.

UPDATE: I needed to make sure Babel-jest was up to date to inherit this.

aarongranick-okta pushed a commit to okta/okta-vue that referenced this pull request May 29, 2020
Tests have started failing (see [Build #699](https://travis-ci.org/okta/okta-oidc-js/builds/401943311)).

I tried upgrading the jest and/or the babel plugins, per these threads:

facebook/react-native#19859
jestjs/jest#6505

But I didn't have any luck.  Locking to the 0.55 series of react-native does seem to fix this problem
alanraison pushed a commit to alanraison/cognito-oidc-pkce that referenced this pull request Jun 3, 2020
Tests have started failing (see [Build #699](https://travis-ci.org/okta/okta-oidc-js/builds/401943311)).

I tried upgrading the jest and/or the babel plugins, per these threads:

facebook/react-native#19859
jestjs/jest#6505

But I didn't have any luck.  Locking to the 0.55 series of react-native does seem to fix this problem
shuowu-okta pushed a commit to okta/okta-react-native that referenced this pull request Jul 10, 2020
Tests have started failing (see [Build #699](https://travis-ci.org/okta/okta-oidc-js/builds/401943311)).

I tried upgrading the jest and/or the babel plugins, per these threads:

facebook/react-native#19859
jestjs/jest#6505

But I didn't have any luck.  Locking to the 0.55 series of react-native does seem to fix this problem
@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
10 participants