ts-jest Questions
1
Solved
My limited brain sometimes has trouble interpreting diffs of arrays of trees of nodes.
I find out outputs from jest like the following to be hard to understand:
Error: expect(received).toEqual(expe...
0
hello I am running typescript with esm and jest and I have a problem with middy:
I had this test:
import { APIGatewayEvent, Context } from 'aws-lambda';
import { lambda } from '../index.js';
descr...
Henceforward asked 4/12, 2023 at 7:35
1
I'm trying to integrate Jest, (ts-jest) into my typescript project which uses styled-components/macros. But for some reason, Jest is complaining with the following error:
ts-jest[versions] (WARN) V...
Stroke asked 20/5, 2022 at 10:54
2
Solved
I'm new to testing React/Typescript apps. I want to unit test my React components, because I'm not satisfied to develop apps without tests at all. The app itself works fine, it's just failing to ru...
Pasty asked 11/6, 2020 at 16:5
13
Solved
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 using the command npm test, I am getti...
Panter asked 14/6, 2019 at 9:15
1
I am trying to use jest to start unit testing and I came across this error like this one.
> npm run unit
> [email protected] unit
> NODE_OPTIONS=--experimental-vm-modules jest --con...
Caponize asked 22/8, 2023 at 11:15
1
The path to my development directory is here.
.
├── README.md
└── business
├── jest.config.ts
├── nodeLayer
│ └── db
│ ├── README.md
│ ├── dist
│ │ └── db
│ │ ├── index.js
│ │ └── index.js....
Urian asked 21/8, 2023 at 9:24
4
Solved
I am trying to test a react typescript project using jest but it's giving a confusing error:
Here is my package.json:
"dependencies": {
"@testing-library/jest-dom": "^5.1...
Blackwood asked 2/5, 2022 at 14:50
3
Solved
Well, using ts-jest 27.x.x, I could access the utils helper by require('ts-jest/utils'), and as you can see in the below picture, it was present in the ts-jest dependency folder:
But in a newer pr...
Paleogeography asked 13/7, 2022 at 2:53
7
I'm trying to run some tests with Jest but I keep getting an error. It's something to do with a TypeScript config file, I already searched but didn't find much. I'm using NodeJS, TypeORM with TypeS...
Million asked 15/3, 2021 at 14:19
0
I've been using jest --coverage to calculate coverage for my code. I've added a coverageThreshold in jest.config.js but this only checks whole codebase/folder coverage.
I also tried jest -o (--only...
Gallium asked 6/7, 2023 at 17:14
8
Recently upgrading my app to Angular 11. Jest has been set up as the default testing framework. Running npm test results in the following error:
● Test suite failed to run
TypeError: Jest: a tran...
0
Issue
Unable to transpile external package exported in ESM syntax
Jest Version
29.5.0
Steps to reproduce
Clone my repo at https://github.com/paulwongx/turborepo-jest-issue
Install packages yarn wo...
Electrolyze asked 8/6, 2023 at 16:6
3
Runing test I get this error
TypeError: Cannot read properties of undefined (reading 'ngModule')
I dont exactly know what is causing this error, but google said circular dependency issue but I am n...
Thirtytwo asked 6/4, 2022 at 16:44
4
My react component uses translations from i18next and I'm trying to create tests for it using JEST. However, nothing is getting translated and I have tried mocking the useTranslation function below...
Tendance asked 23/5, 2019 at 0:27
1
I have "jest": "^29.2.1". My unit tests output errors like this:
ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
transform: ...
Wildee asked 7/4, 2023 at 3:43
0
Summarise the problem
I'm hitting the following issue whenever running tests in Jest for an angular project:
EBUSY: resource busy or locked, open 'C:\Users\<username>\AppData\Local\Temp\jest\...
Inverter asked 19/4, 2023 at 9:36
0
I have a typescript project with sequelize, and I have two tests that needs to mock the sequelize.authenticate function with different outputs. Here is what I have:
test('Return successful health',...
Insurrection asked 17/4, 2023 at 21:5
0
I am using typescript and the code works fine the problem is when I use jest to write test case if throws me error in one of the json file imports informing it doesn't understand " assert{ typ...
Beret asked 22/3, 2023 at 5:2
1
I using jest for running my unit test but I am getting an error.
TypeError: Cannot read properties of undefined (reading 'getVideoTracks')
Any suggestions on how to test the below line in jest
[vi...
Fluorinate asked 4/4, 2022 at 11:38
5
Solved
After upgrading Angular to v 13 when I try to run my tests in the jest environment I have an error:
Cannot set base providers because it has already been called
import 'jest-preset-angular/setup-je...
Straka asked 8/11, 2021 at 11:13
2
I am currently setting up Jest in angular 9 with jest-preset-angular version 9, the code runs but i am getting the following error:
TypeError: Cannot read property 'ngModule' of null
not sure how t...
7
Solved
After configuring jest, node.js and typescript the script npx jest throws the error in a console
TypeError: Jest: a transform must export something.
at C:\projects\project-api\node_modules\@jest\t...
2
Solved
I'm having trouble trying to mock a class and a constructor.
I have a App.ts class that I want to test:
class App {
public server: Express;
constructor() {
this.server = new Express();
this....
Amends asked 22/4, 2020 at 20:11
5
I'm trying to build a mobile application with typescript, react-native, expo and jest. When I'm trying to run tests:
FAIL src/components/Button/tests/Button.test.tsx
● Test suite failed to run
...
Cockup asked 7/1, 2022 at 14:26
© 2022 - 2024 — McMap. All rights reserved.