Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
659 views

I am using Jest with React to write unit test cases for my project with the following specs. When I run yarn test (Jest --coverage). It gives me below error. Error: Test suite failed to run Jest ...
0 votes
2 answers
555 views

I'm trying to run the test case for the app. But its showing below error. Can someone help me to clear the issue. Attaching the code repo. https://github.com/Arun12Muralidharan/team_tracker I can't ...
2 votes
1 answer
1k views

As part of nodejs 18 upgrade, the following versions were upgraded. "react": "17.0.2", "react-dom": "17.0.2" "jest": "29.7.0", "jest-...
2 votes
1 answer
3k views

Using Jest and Enzyme for testing in React. For one function inside a react component I am using setTimeOut to change a status. Now to test that function in jest I am using jest.useFakeTimer. Using it ...
1 vote
1 answer
2k views

I'm trying to test a react component using jest and enzyme. There is a useEffect trigger when a prop changes and I am unable to test it properly. The assertion fails due to undefined value. This is my ...
0 votes
1 answer
73 views

I am having issue with testing a component that makes a fetch call inside a useEffect. What's happening is that, state is being updated but the component is not rendering the data from the fetch call ...
0 votes
1 answer
94 views

I am facing a issue while testing my api call with callback functions, service not returning promise it give me response in callback function. Here is my code. // UserService.js addUser(paras, ...
-1 votes
1 answer
40 views

const goToLoginPage = () => { navigation.navigate(AppConstants.LOGIN_SCREEN) }); <TouchableOpacity onPress={goToLogin}> <Text>OK</Text> </TouchableOpacity> ...
Swift's user avatar
  • 917
1 vote
0 answers
1k views

I'm working on a React Native project and I have a class component that includes a FlatList with TouchableOpacity components. I want to write test cases for this component using Jest and Enzyme to ...
0 votes
0 answers
26 views

How to write test cases for below code const getNews = async (page: number) => { try {`enter code here` setLoader(false); console.log(page, 'page'); const ...
0 votes
1 answer
776 views

I have a React component called ChoiceOfFundForm that includes a download button. When the download button is clicked, it triggers the handleClick function, which sets the loading state to true and ...
1 vote
1 answer
320 views

I have a component which has a "Navigate" component inside it. I want to test this navigation. But whenever I try to render the component, the test case gets stuck and keeps on running ...
1 vote
0 answers
541 views

My test case looks something like this : In this test case, I've purposefully pushed the route in history object and given component as React.lazy(). Please let me know, what is incorrect here ? ...
-1 votes
1 answer
87 views

I have a react component that needed to be tested, I am using jest with enzyme for the testing. The react component imports other functions to operate that need to be mocked. I am using it just to ...
0 votes
1 answer
148 views

We are upgrading our application to React 18 and are in need to migrate our tets from Enzyme to RTL. I am struggling to find a good solution to rewrite my tests: function useButtonTests( // eslint-...

15 30 50 per page
1
2 3 4 5
...
286

AltStyle によって変換されたページ (->オリジナル) /