-1 votes
0 answers
32 views
Issues with clearing scheduled timers from the fake timer internal queues when testing React hooksI am using Vitest ^3.2.4 and React Testing Library ^16.3.0. I am having hard time clearing assigned intervals when testing. vi.clearAllTimer does clear the scheduled timers, but it totally prevents me ...
asked yesterday-1 votes
2 answers
135 views
Next.js and Jest: TypeError `the "original" argument must be of type function`I am new to Next.js but not to React and Jest; this is the first test suite I'm setting up in Next.js. I have the following (extremely minimal, but this example does cause the error) component I am ...
asked Jun 20 at 21:52-1 votes
1 answer
342 views
Test failure after upgrading to React Router v7.6.2I am experiencing an issue after upgrading to React-Router version 7.6.2. I was able to replicate the failure: StackBlitz. Note that this test passed when I had v6 of React-Router-DOM. The problem ...
asked Jun 12 at 9:530 votes
1 answer
106 views
Vitest react wait for function in useCallback to be in ready stateI have the following hook: function useWelcomeMessage() { const { data, error} = useGetWelcomeMessage(); const printMessage = useCallback(async () => { if (data) { alert(data) ...
asked May 23 at 10:220 votes
1 answer
17 views
How to Assert the Absence of an Element After an Async API Response in Testing LibraryI'm wondering if it's better to use findBy together with rejects.toThrow instead of using queryBy with not.toBeInTheDocument when checking that an element is not displayed in cases like the following. ...
asked May 15 at 1:340 votes
1 answer
35 views
Testing library throws error with finding input element with slight changeI am testing my Input element by 2 way. adding value and click on button to "todo list" works fine adding value and enter the "input' field, but throws error. any one clarify the ...
asked May 9 at 11:501 vote
1 answer
102 views
React 19 'use', NextJS 15 async params and React testing-libraryUsing NextJS 14 and react testing-library, we previously used to test client components and client-only pages that take dynamic URL parameters like this: type PageProps = { params: { date: string }...
asked May 9 at 1:021 vote
0 answers
67 views
What exactly are the conditions that React will give the act warning?I know that this is a well trodden topic, but most of the articles and help topics on this talk about how to avoid, and don't actually detail what exactly causes it. I have a simple example of how we ...
asked Apr 30 at 2:490 votes
0 answers
58 views
Vitest: TypeError: Unknown file extension ".woff" in package from React TS project with vitestI am trying to set up unit tests for a frontend project. Currently, i am trying to use vitest, since we use vite as well. Additionally i am going with HappyDom and TestingLibrary. Now, i am facing a ...
asked Apr 7 at 12:060 votes
1 answer
135 views
How can one test Chakra v3 UI Select in NextJS with Jest?I'm building a NextJS (react) app with Chakra UI (version 3). I'd like to write unit tests, but I don't know to handle the way Chakra UI v3 handles select. Here's a sample test app: 'use client'; ...
asked Mar 28 at 2:160 votes
0 answers
101 views
How do i test Lexical Toolbar Plugin and trigger onError of initialConfig?I am using ToolbarPlugin from Lexical and using the code from Lexical repo. My Sonarqube has flagged below code for test coverage and am not sure what test needs to be inlcuded: `const $updateToolbar =...
asked Mar 24 at 11:030 votes
0 answers
28 views
When using react-query, how to write unit tests for the scenario of Dependent Queries?how to write unit tests for useUpdateTodo hook without mock useGetUserId // Get the user const useGetUserId = ()=>{ const { data: user } = useQuery({ queryKey: ['user', email], queryFn: ...
asked Mar 17 at 8:20 Can't successfully test a custom hook using useState and useEffectWhile learning React, I'm trying to understand custom hooks. I've created a simple one updating an internal "step" on creation, cleanup, and allows for external updates. But I'm struggling ...
asked Mar 13 at 17:09-2 votes
1 answer
62 views
Can anyone render react-router-dom components with react-testing-library?After a lot of trial and error I cannot get RTL to render any components from react-router-dom. I am using
[email protected], @testing-library/
[email protected], @testing-library/
[email protected], react-router-...
asked Mar 11 at 12:550 votes
1 answer
41 views
React testing library form validationI'm stuck on a validation scenario in my Nextjs app, I have a form with some inputs and when a user tries to submit an invalid form an error message should be shown in the form. However I think there ...
asked Mar 8 at 16:12RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4