Questions tagged [babel-jest]

Need help converting your ES6 code to ES5 for Jest testing? Look no further than this Babel transpiler designed specifically for that purpose.

"Exploring the world of jest.doMock: A guide to mocking

Here is the code snippet I am testing: ... import data from '../data/mock.json'; // function is async export const something = async () => { try { ... if (!data) { throw 'error is here!'; } return data; ...

Error: The plugin 'jest' declared in '.eslintrc' failed to load. The value undefined used to extend a class is not a constructor or null

After updating react-scripts to the latest version 5.0.0, I encountered the error above. Following one article's suggestion, I upgraded @typescript-eslint to version ^5.0.0 to be compatible with eslint version ^8.3.0, which comes by default with the upda ...

Configuring Jest unit testing with Quasar-Framework version 0.15

Previously, my Jest tests were functioning properly with Quasar version 0.14. Currently, some simple tests and all snapshot-tests are passing but I am encountering issues with certain tests, resulting in the following errors: console.error node_modules/vu ...

Encountering an unexpected token while running Jest tests on a React application

I'm in the process of creating a boilerplate using React, Redux, ReactRouter, and Jest. However, I've encountered an issue while testing a component with react-test-renderer. I have implemented two types of tests: unit tests for my Redux actions and snaps ...

Unit test failure attributed to misconfigured ECMAScript module setup

I am currently using Vue 3 along with Jest for testing purposes. I have created a simple code snippet to test, which is displayed below. Following some suggestions on Stack Overflow, I made some modifications to the babel.config.js and package.json files a ...

The method wrapper.setValue() is not suitable for use on EL-INPUT

Attempting to call a Vue component for unit testing with Jest, trying to set a value in an input text field. Below is the content of my "file.vue" file: <el-form-item label="Nombre" data-test="id-form"> <el-input v ...

Jest is not producing any output at all when executing tests

Below is a snapshot of my package.json: "jest": { "cacheDirectory": "/tmp/jestCache", "scriptPreprocessor": "node_modules/babel-jest", "modulePaths": [ "<rootDir>/app/static/react/" ], "moduleDirectories": [ "node_modules" ...