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
I'm creating a testing for my express app. The project has multiple test files. In each module the server instance is required at beforeEach() method and closed
How can I get the arguments called in jest mock function? I want to inspect the object that is passed as argument.
It's documentation says that while dealing with async code, expect.assertions(x) should be written. What exactly do assertions refer to? Is it a term of plain J