Category "ts-jest"

How to mock and check that a function from a library in Jest framework?

I have a button with "Download" text on it defined in ReactJS code. Now, I want to write a unit test to check that this function is getting called when this but

Mock OpenSearch Client in jest unit test

I'm trying to mock out the opensearch client for testing purposes and am running into an error. My app is using OpenSearch (@opensearch-project/opensearch) and

Cannot find name 'it' in Jest TypeScript

I try to create an intial setup for Jest in React + TypeScript. I have completed the initial setup and try to check whether the test runs. When I run the test u

How do I mock AWS S3 GetObjectCommand with jest using the v3 sdk?

Testing an s3 upload? The method to test is export class ProcessData { constructor() {} async process(): Promise<void> { const data = await s3Cl

How to set up Jest w/ESM to recognize non-cjs modules in node_modules

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

How to create nested moduleNameMapper in Jest?

My simplified jest.config.js is: module.exports = { preset: "ts-jest", collectCoverage: true, collectCoverageFrom: [ "src/**/*.ts", "!**/node_mod

Typescript paths not resolving when running jest?

Attempting to convert this project over to jest using these instructions. I have everything working except for the files that use the paths configuration: "pa