python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Cannot spyOn on a primitive value; undefined given - Testing a function execution in onChange in connected component
New to testing and This is a connected component using redux. I am testing if the maskPromoCode function is called. With the current test code, the error says: Cannot spyOn on a primitive value; undef...
DollyBeeBee
Votes: 0
Answers: 1
How do we upgrade our vue.js/jest tests past version 24? Things break a little at v26, more at v27
We're currently testing a vue.js app with jest 24.9.0, ts-jest 24.30, and @types/jest 24.9.1 . We see that jest is at v27 and I looked at upgrading, but things broke all over the place, so I backtrack...
Eric
Votes: 0
Answers: 1
getByTestID not working for custom component
Working on writing a unit test for a large component. I've written one before for a smaller component, but this has several other custom components nested inside. I'm trying to select it so I can then...
Slashy
Votes: 0
Answers: 1
XMLHttpRequest mock - Jest mockImplementation doesn't create class with specified methods
I am trying to mock XMLHttpRequest but without success. Based on answers here I've managed to do following:
const xhrMockClass = () => ({
open: jest.fn(),
send: jest.fn(),
setRequestHeader: j...

karlosos
Votes: 0
Answers: 0