I am trying to run tests using Jest, however I am getting this error: jest.mock is not a function What am I doing wrong? Here's my CodeSandbox: https://co
I have a custom eslint-config that has several plugins for various packages, including jest. I have the main set to an index which just extends other files. Lo
Gist I have a Monorepo with solely Typescript packages. When I run tsc --build all packages will be compiled to Javascript. This worked fine until I added a pa
How to launch jest in debug mode on the current opened file, and only this one, regardless of the OS (windows, linux, mac). The problem: When using vscode und
Edit: Run npm install @types/jest To fix Just trying to type it() and the auto suggestion is isTag I've tried adding a jsconfig.json { "compilerOptions": {
Is there a difference between expect(screen.queryByText('<something>')).toBeInTheDocument(); And screen.getByText('<something>'); (The specific ge
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