I have been trying to use the retry-axios library and assert the number of times in a "get" has been called without any luck. Here is my setup: axios.config.ts
I'm writing an async test that expects the async function to throw like this: it("expects to have failed", async () => { let getBadResults = async () =>
Is there a reason I would prefer one method over the other? Here are some examples: describe('some tests', () => { [1, 2, 3].forEach(num => { test(
I want to install typescript and jest in a create-react-app-based app. I feel that since this is such a common installation choice there must be at least one "e
I'm writing a test in jest for a svelte component which dynamically imports another component. The following snippet is the part where the dynamic import happen
I have a class that is responsible for setting the theme for my application. I'm trying to test that it throws an error if you give it a theme that it does not
I'm new to react testing library. I am trying to test a simple component that call some apis and then it fills inputs with the data of these apis. But when I ru
I'm new to react testing library. I am trying to test a simple component that call some apis and then it fills inputs with the data of these apis. But when I ru
Have got a successful jest/esm setup, however occasionally a module is released that specifies both a main key (for commonjs) and a module key (for ESM) in its
My simplified jest.config.js is: module.exports = { preset: "ts-jest", collectCoverage: true, collectCoverageFrom: [ "src/**/*.ts", "!**/node_mod
It is necessary to test the component SlotItem. In it function is transferred through a context this.context.i18n.t("free") My component: import React from 'r
I try to mock axios module inside my test file like this // mycomponent.test.js import axios from 'axios'; jest.mock('axios', () => ({ get: jest.fn(() =&
I try to mock axios module inside my test file like this // mycomponent.test.js import axios from 'axios'; jest.mock('axios', () => ({ get: jest.fn(() =&
I tried to test a required input field with React Testing Library and Jest by testing the existence of the popover, but I failed. I tried several variants and n
Current Working Solution Using this html: <p data-testid="foo">Name: <strong>Bob</strong> <em>(special guest)</em></p> I
I have the following react hook which brings focus to a given ref and on unmount returns the focus to the previously focused element. export default function u
I'm trying to achieve 100% coverage in a project and this is the only file I can't test because I haven't got any idea of how to do it. I don't even know where
I am trying to set up monorepo to run all of its Jest tests at once. In each package, I'm using react-app-rewired to get Babel to transpile code imported from o
After adding the environment variable import.meta.env.VITE_* in my code, the tests with vue-test-utils started to fail, with the error: Jest suite failed to run
When using @vue/cli-plugin-unit-jest, I am receiving coverage reports each time I run my unit tests, regardless of whether I have the --coverage flag in the exe