Answer the question
In order to leave comments, you need to log in
Error when testing a Vue component with Jest in a component using jquery because of this I get a ReferenceError: $ is not defined?
Here is the error in the console
Answer the question
In order to leave comments, you need to log in
Guys, I'm sorry, I found a solution. I'm not fully familiar with the jest library. Because it doesn't use webpack. I added the setup.js file and connected JQuery and other necessary libs there. After I wrote the following in jest.config.js
setupFilesAfterEnv: [
"<rootDir>tests/js/setup.js"
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question