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

chore: update example to react-native@0.62 #9746

Merged
merged 6 commits into from
Apr 23, 2020
Merged

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Apr 2, 2020

Summary

It's new, it's fresh.

One test errors out, I've commented on it.

Test plan

Green CI

expect(tree).toMatchSnapshot();
done();
},
done
Copy link
Member Author

Choose a reason for hiding this comment

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

this now errors (and times out since we never call done), so I added this. It'll fail, this is the full error:

TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
    at _nonIterableRest (/Users/simen/repos/jest/node_modules/react-native/Libraries/Image/Image.ios.js:24:775)
    at _slicedToArray (/Users/simen/repos/jest/node_modules/react-native/Libraries/Image/Image.ios.js:24:720)
    at /Users/simen/repos/jest/node_modules/react-native/Libraries/Image/Image.ios.js:34:37
    at tryCallOne (/Users/simen/repos/jest/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/simen/repos/jest/node_modules/react-native/node_modules/promise/lib/core.js:123:15
    at flush (/Users/simen/repos/jest/node_modules/asap/raw.js:50:29)
    at processTicksAndRejections (internal/process/task_queues.js:76:11)

Copy link
Collaborator

@thymikee thymikee Apr 4, 2020

Choose a reason for hiding this comment

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

Prior to RN 0.62, Image.getSize used NativeModules.ImageViewManager on iOS (and NativeModules.ImageLoader for Android) under the hood, which was mocked in react-native preset: https://github.com/facebook/react-native/blob/caa7829aac01256a1f01dfda73f7d0a5c0371064/jest/setup.js#L214-L223.

With facebook/react-native@d37baa7, it was replaced by NativeImageLoaderIOS which doesn't have a mock.

I can contribute the mock to jest/setup.js, but wanted to know how's Image used at FB that it didn't surface. Maybe it's entirely mocked?

cc @cpojer

Copy link
Member

Choose a reason for hiding this comment

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

We are doing some funky stuff internally, that's probably why we didn't notice. I recommend changing the example to something else.

},
"devDependencies": {
"@babel/core": "*",
"@babel/preset-env": "*",
"babel-jest": "*",
"jest": "*",
"metro-react-native-babel-preset": "*",
"react-test-renderer": "16.9.0"
"metro-react-native-babel-preset": "^0.58.0",
Copy link
Member Author

@SimenB SimenB Apr 2, 2020

Choose a reason for hiding this comment

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

I've had to manually roll back this in the lock file a few times, and it should be at a specific version anyways, so let's specify it

@SimenB
Copy link
Member Author

SimenB commented Apr 2, 2020

Gotta ignore the lint errors as well probably. Weird they show up now...

@SimenB
Copy link
Member Author

SimenB commented Apr 23, 2020

@thymikee wanna make some change here, or should I just delete the funky test and you can circle back to a better example later?

@thymikee
Copy link
Collaborator

I have the PR open to act on, but seems like it may slip a bit. So I'd say – let's remove the test for now and followup later. I planned to revamp the RN example to use https://github.com/callstack/react-native-testing-library if you don't mind.

@SimenB
Copy link
Member Author

SimenB commented Apr 23, 2020

I planned to revamp the RN example to use https://github.com/callstack/react-native-testing-library if you don't mind.

Nah feel free, I don't have an opinion either way 🙂

@SimenB
Copy link
Member Author

SimenB commented Apr 23, 2020

No idea why 0.62 broke eslint-plugin-import, has been reported, though facebook/react-native#28549

@SimenB SimenB merged commit 58d199d into jestjs:master Apr 23, 2020
@SimenB SimenB deleted the rn-0.62 branch April 23, 2020 20:44
jeysal added a commit to mmkal/jest that referenced this pull request Apr 26, 2020
…pshots

* upstream/master: (39 commits)
  Prints the Symbol name into the error message with a custom asymmetric matcher (jestjs#9888)
  Show coverage of sources related to tests in changed files (jestjs#9769)
  fix: don't /// <reference types="jest" /> (jestjs#9875)
  noCodeFrame respects noStackTrace (jestjs#9866)
  chore: update example to react-native@0.62 (jestjs#9746)
  Improve source map handling when instrumenting transformed code (jestjs#9811)
  Update .vscode/launch.json settings (jestjs#9868)
  chore: verify all packages have the same engine requirement (jestjs#9871)
  fix: pass custom cached realpath function to `resolve` (jestjs#9873)
  chore: mock stealthy-require in tests (jestjs#9855)
  chore: update resolve (jestjs#9872)
  chore: run CircleCI on node 14 (jestjs#9870)
  Add an option to vscode settings to always use workspace TS (jestjs#9869)
  fix(esm): handle parallel imports (jestjs#9858)
  chore: run CI on Node 14 (jestjs#9861)
  feat: add `@jest/globals` package for importing globals explici… (jestjs#9849)
  chore: bump resolve package (jestjs#9859)
  chore(runtime): simplify `createJestObjectFor` (jestjs#9857)
  chore: fix symlink creation failures on windows in tests (jestjs#9852)
  chore: skip mercurial tests when no hg installed (jestjs#9840)
  ...
jeysal added a commit to mmkal/jest that referenced this pull request Apr 26, 2020
…pshots

* upstream/master: (39 commits)
  Prints the Symbol name into the error message with a custom asymmetric matcher (jestjs#9888)
  Show coverage of sources related to tests in changed files (jestjs#9769)
  fix: don't /// <reference types="jest" /> (jestjs#9875)
  noCodeFrame respects noStackTrace (jestjs#9866)
  chore: update example to react-native@0.62 (jestjs#9746)
  Improve source map handling when instrumenting transformed code (jestjs#9811)
  Update .vscode/launch.json settings (jestjs#9868)
  chore: verify all packages have the same engine requirement (jestjs#9871)
  fix: pass custom cached realpath function to `resolve` (jestjs#9873)
  chore: mock stealthy-require in tests (jestjs#9855)
  chore: update resolve (jestjs#9872)
  chore: run CircleCI on node 14 (jestjs#9870)
  Add an option to vscode settings to always use workspace TS (jestjs#9869)
  fix(esm): handle parallel imports (jestjs#9858)
  chore: run CI on Node 14 (jestjs#9861)
  feat: add `@jest/globals` package for importing globals explici… (jestjs#9849)
  chore: bump resolve package (jestjs#9859)
  chore(runtime): simplify `createJestObjectFor` (jestjs#9857)
  chore: fix symlink creation failures on windows in tests (jestjs#9852)
  chore: skip mercurial tests when no hg installed (jestjs#9840)
  ...
@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.

4 participants