I want to test a node API using Jest. I am testing the routes and websockets. Testing the routes was no problem. I simply started the server using the setupFile
Creating a jest test like: test("btoa", () => { expect(btoa("aaa")).toStrictEqual("YWFh"); }); fails with ReferenceError: btoa is not defined however, no
In my case I have a test file containing a few hundred tests using jest describe('my test-suite', () => { test('test 1', () => { expect(1).toBe(
search looks like this search: "?productId=1234" and changeId is action const urlParams = new URLSearchParams(window.location.search); const productId = urlP
I have error in the following below test. My node version is : v12.10.0. is there any alternative of setTimeout? test('demo code', async () => {
I want to create a unit test for two events, on focus and on blur. I am using vueJS and jest. handleFocus(event) { if (this.blured === true)
I was struggling with a test issue for my custom useLazyQuery hook. My first test is passing but the second one is failing. What am doing wrong for the second t
2 questions in 1 here. Why do I get an error message for my jest.spyOn saying that createMappingsDirectory is not a function? Secondly, I think where I’ve
I'm trying to mock axios.create() because I'm using its instance across the app and obviously need all of its implementation which is destroyed by the mock, thu
I am using typescript with typeorm and i have an repository like this: import { EntityRepository, getRepository, createQueryBuilder } from 'typeorm'; @EntityR
I want to verify that a given array doesn't contain any of a list of values. There is expect.arrayContaining but I don't get how it is supposed to be used for t
Currently I am using automatic imports in my Next.js project, configured by jsconfig.json in the root directory: { "typeAcquisition": { "include": ["jest"
Jest is raising this error on one of my components: Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/fun
I'm testing a component using Vue test utils and Jest and I'm wondering what's the best way to test you are passing the correct values to a child components in
For an angular v12 project which uses jest I just updated jest to version 28. Now, however, I get the following error FAIL src/app/components/update-input/upda
Hi! I'm attempting to write a "simple" test to check for a react class component state change. Specifically, I'm testing if the lat(latitude) and lng(longitu
During unit testing, I am getting undefined error, while executing svelte component with json file. Restaurant.svelte : import data from '../Data/restaurants.js
Is there a way to get a proper error message? when i do $npm test and I intentionally break my code(cough cough remove a line of code) I get this message src/re
so I am trying to test that the onSubmit function is getting triggered if the button is clicked - the way im doing this is through testing the internals of the
The popup has a click away listener which closes it when a click event occurs outside the component. I need to test that the popup has closed. it.only('clicking