Skip to main content

All Questions

0 votes
0 answers
43 views

How can I make my Jest test recognize jsx/tsx syntax?

My test is refusing to recognize < angle brackets. Jest encountered an unexpected token Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard ...
johnrubythecat's user avatar
2 votes
1 answer
385 views

Debugging Jest with Chrome stops in Jest but not on test debugger statement, how to make it stop in the test?

I've gotten Jest debugging up and running many times. For some reason in this repo (that I'm new to) the debugger will stop in jest.js: but won't stop in the test itself. The test: it('opens the ...
jcollum's user avatar
  • 46.7k
1 vote
0 answers
191 views

TypeError: WalletLib.WalletClient is not a constructor

I'm using a custome SDK in my React Native project and importing it as: import * as WalletLib from 'wallet-lib'; and then using its sub classes and function like below: const client = new WalletLib....
Muhammad Afaq Raiz's user avatar
2 votes
0 answers
348 views

App has not responded to the network requests below : while running the detox test ( Detox + Jest )

My Setup detox : 18.0.0 jest : 26.6.3 react-native-cli : 2.0.1 nodejs : 14.15.4 npm : 6.14.10 yarn : 1.22.10 OS : ubuntu 18.04 real connected device : Samsung M 01 Please find the image on below ...
Haresh Prajapati's user avatar
3 votes
1 answer
3k views

Unable to debug test case using Jest in chrome under node devTools

I just started using Jest. For debugging under testcase file; describe("Filter function", () => { test("it should filter by a search", () => { const input = [ { ...
Swift's user avatar
  • 907
3 votes
2 answers
4k views

I downloaded a newer version of Jest and now my react app won't open

I am trying to learn React Native and I downloaded Jest to help me test apps. I didn't realize that React automatically downloaded Jest. Now if I run cd react-app/ [return] npm start [return], my ...
Kachow095's user avatar
10 votes
4 answers
8k views

How to fix React Native error "jest-haste-map: Haste module naming collision"?

When I installed react-native-popup-menu, I faced such error. This is error code Looking for JS files in E:\react-native\.............\ Loading dependency graph...(node:9460) ...
Julian's user avatar
  • 1,622
1 vote
1 answer
403 views

How To Spy On An Exported and Mocked Function In Jest

I am trying to mock a module (which has an exported function[and this is also mocked]). I would like to spy on the exported function to check that it was called with something. This is my code... ...
Exitos's user avatar
  • 29.8k
7 votes
1 answer
6k views

Why Will Jest Not Run? "TypeError: environment.setup is not a function"

really battling here. My Circle CI tests have failed with a FAIL ./App.test.js ● Test suite failed to run SyntaxError: Unexpected token ) I try to run Jest locally on my machine (a CRNA one) ...
Aid19801's user avatar
  • 1,166
2 votes
1 answer
2k views

Should I use jest or jest-cli on a react native project from scratch?

When creating a react-native project from scratch I am getting jest in devDependencies and test passes! But now I am getting when doing my tests: (node:32629) UnhandledPromiseRejectionWarning: ...
locropulenton's user avatar
1 vote
0 answers
1k views

Error when trying to test my React-native Component. `TypeError: _this._scrollView.scrollTo is not a function`

I'm trying to do some unit testing for my React-native application, but I'm facing a weird issue here. I don't know where the issue is coming from. I looked on React-native GitHub and StackOverFlow, ...
MohmedBm's user avatar
4 votes
1 answer
1k views

What does single & and single | operators do in flow js?

There is a piece of code in one of the files in react-native repo here as shown below: export type Operation = & {instanceID: DebugID} & ( | {type: 'mount', payload: string} | {...
Varun Gupta's user avatar
  • 3,154
1 vote
1 answer
464 views

Debugging React Native with Node shims in VS Code

I have a React Native project (created from the Ignite CLI 2.0.0 default boilerplate) that needs some dependencies on node-based packages. So, I created a transformers.js, babel-transform.js and a rn-...
Arnold Schrijver's user avatar
7 votes
0 answers
962 views

Unexpected token import native-base-shoutem-theme/index.js:1 probably native-base / react-native

) I have a big problem, I spend all day on fixing that and finding consensus between dependencies of few packages. I have problems with running tests: Users/P/Projects/react-native/node_modules/...
Darex1991's user avatar
  • 897