-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 [email protected] #9746
Conversation
expect(tree).toMatchSnapshot(); | ||
done(); | ||
}, | ||
done |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
Gotta ignore the lint errors as well probably. Weird they show up now... |
@thymikee wanna make some change here, or should I just delete the funky test and you can circle back to a better example later? |
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. |
Nah feel free, I don't have an opinion either way 🙂 |
No idea why 0.62 broke eslint-plugin-import, has been reported, though facebook/react-native#28549 |
…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 [email protected] (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) ...
…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 [email protected] (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) ...
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. |
Summary
It's new, it's fresh.
One test errors out, I've commented on it.
Test plan
Green CI