All Questions
Tagged with testing javascript
4,916 questions
0
votes
0
answers
42
views
Cypress not redirecting after clicking "Confirm" button (possible async issue?) [closed]
Title: Cypress not redirecting after clicking "Confirm" button (possible async issue?)
I'm writing an E2E test using Cypress to verify that after clicking the "Confirm" button on a ...
0
votes
0
answers
24
views
Test Case Failing After Modifying Average Line Rendering Logic in Chart Library
I'm currently working on a charting library and have encountered an issue with a test case failing after I modified the rendering logic for an average line drawing tool. The requirement was to remove &...
0
votes
0
answers
43
views
Testing Storybook with Cypress gets "Axe is already running" error
I am currently using Storybook v8.6.7 and Cypress v.14.2.0 with cypress-axe v1.6.0.
Most tests run without problem, but sometimes i get an Axe is already running. Use await axe.run() to wait for the ...
-1
votes
1
answer
77
views
Unable to download files in playwright javascript [duplicate]
Button is clicked and file is getting downloaded but I am unable to see any file which is downloaded.
Here is the code:
test('Upload Download Excel Validation', async ({ page }) => { await page....
0
votes
0
answers
58
views
Playwright execute setup database with 2 devices
I have 2 devices, chromium and a tablet. I want to execute a setup db script before each device, because the execution of the test on the first device may alter the results of the second one.
So the ...
-4
votes
1
answer
112
views
createMemoryRouter throws TypeError: Cannot destructure property 'basename' of 'React10.useContext(...)' as it is null [closed]
Using createMemoryRouter to create router to render doesn't work. It renders and error page.
import { vi, describe, it, expect } from 'vitest'
import { render } from '@testing-library/react'
import { ...
0
votes
1
answer
468
views
Failed React test with console message: "Cannot find module 'react-router-dom'"
I'm making a unit test in a React application (that i created with the command "create-react-app" without using any framework or build tool), that i am developing for a university project, ...
0
votes
1
answer
48
views
Jest Mock Function cannot recognize return types
I've been searching and trying for hours, but I still can't fix the issue.
It keeps complaining:
Argument of type '{ commit: Mock; rollback: Mock; }' is not assignable to parameter of type 'never'.
(...
0
votes
0
answers
11
views
How to Test renderCart function without executing dependent paymentSummary.js in Jasmine?
I’m trying to write a unit test for the renderCart function in my orderSummary.js file using Jasmine. However, I’m encountering an issue where the paymentSummary.js module, which is imported in ...
0
votes
0
answers
31
views
Test can't find conditional render component, disappearing too quickly
I am displaying a loading indicator whilst I wait for an async process to occur, however I believe my test might be missing it being displayed because the async process is too quick?
const [isLoading, ...
2
votes
0
answers
74
views
Imports from barrel file don't work with JEST
I have long-term problem in my tests, when I test something have import from barrel file. Error is same everywhere:
import { funcName } from "../../";
TypeError: (0 , common_1.funcName) is ...
3
votes
1
answer
359
views
Mocking node:crypto return value with Vitest
I tried following another related post on this topic with the creator's same outcome.
Since its post is dead I'd like to try again if someone has an idea on how to mock the node:crypto function or ...
0
votes
1
answer
38
views
Testing functionality of links with testing-library
This is my first time using the react-testing library. I have a React a custom React component that has a clickable link which will download a file that is stored in a the Redux store. See the code ...
0
votes
0
answers
24
views
Wanted to simulate an API or network error to display the error modal in testcafe
test('should amount field and name field reset after submit', async ()=>{
const amountInput = await Selector('.amount');
await t.typeText(input, 10);
const nameInput = await Selector('.name');...
0
votes
1
answer
69
views
How to execute the Node.js test runner via JavaScript API with multiple reporters?
The Node.js test runner supports using multiple reporters by specifying the command-line options --test-reporter and --test-reporter-destination multiple times.
For example, when executing the ...