I'm trying to implement database population by using a migration function. The code works perfectly, it saves all the data into the database, but the test for t
I have a typescript module with a function that I'm trying to test with jest. The function I'm trying to test uses a typescript class that's defined in the same
I am trying to set a cookie session to a post request in supertest but I cannot. This is my test code: const app = express(); app.set("trust proxy", true); app
I am new to writing test cases in jest and i wanted to test 'mark' function and want to mock 'request' node module. let's say this file's name is app.js and tes
I have Jest tests that are running against the dockerized Neo4j Database, and sometimes they fail on CircleCI. The error message for all 25+ of them is : thrown
I am trying to unit test my function that call useQuery from @apollo/client. Here's what I have done getPixelID.ts import { useQuery } from '@apollo/client'; im
I'm trying to write a test that tests the various method calls to other methods within the same file. So far, I've written tests for two different methods, one
i have an app that's using the @slack/web-api package through the named import WebClient. i want to test one of the controllers that uses a model that in turns
I am testing some express middlewares with jest. it("should throw 400 error if request.body.id is null", () => { const req = { body: { id: null } } as an
I started writing unit tests recently. When I try to test the service of the Angular component, I usually mock it. Therefore, if someone deletes the line of the
I'm using Restify for my API and I'm trying to write tests for my endpoints. At first, I had only a test for ping and it was okay, but now, after I added a new
Jest 26 shipped a new implementation of fake timers based on @sinonjs/fake-timers. Previously I used const flushPromises = () => new Promise(setImmediate); a
I want to test the following React component import React, { useContext, useState } from "react"; import { IntlProvider } from "react-intl"; export const Conte
The UI I'm working on is rendered differently based on the response received. I would like to test the UI when a 4xx and 5xx responses are received. My api hand
I have an svg inside a React component that renders conditionally. <div className='avatar'> {gender === true ? <MaleAvatar /> : <FemaleAvat
I have a TextArea component that takes JSON {"someKey": "someValue"}. When I inspect the dom, {"someKey": "someValue"} shows up just fine in the inspector. Howe
Question is exactly same here in fact but has different context: How to mock not installed npm package in jest? I am part of a project where new Module Federati
skipped test When pressing debug on the test it just skips it. It works for other tests in different repositories that I have, but for this specific one it does
I'm trying to update my NodeJS12 & TypeScript app to Node16, one if the reasons is the need to use top-level-awaits. The code compiles correctly after the u
I'm having this issue when test react-native component with jest and enzyme TypeError: _enzymeAdapterReact.default is not a constructor Here is my dev dependen