testing
See original GitHub issueI’m trying to test by react-native testing library but I got this error
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it.
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
/node_modules/react-native-flash-message/src/index.js:2
import FlashMessageWrapper, { getFlashMessageStatusBarHeight, styleWithInset } from "./FlashMessageWrapper";
^^^^^^
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
COVID-19 Testing: What You Need to Know - CDC
Viral tests look for a current infection with SARS-CoV-2, the virus that causes COVID-19, by testing specimens from your nose or mouth. There...
Read more >Community-Based Testing Sites for COVID-19 - HHS.gov
Find Testing Resources in Your State. COVID-19 tests are available to everyone in the U.S., including the uninsured. Select your state below to...
Read more >Testing.com: Order Lab Tests and Blood Tests Online
Hundreds of easy-to-read lab testing guides. Confidential, secure and convenient online lab test ordering powered by trusted physician networks. Compassionate ...
Read more >Get free at-home COVID-19 tests this winter
15,000+ Free Testing Sites. No-cost antigen and PCR COVID-19 tests are available to everyone in the U.S., including the uninsured, at more than...
Read more >Find COVID-19 Tests
Find COVID-19 tests near you. Four ways to get tested: free community events or fixed test sites in NC, your medical provider or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mustafakameldev I spent some time on it and finally, adding this to the Jest configuration helped me:
Inspired by https://stackoverflow.com/a/55803188
Thanks that’s helped