Hi everyone. I'm trying to set up some component testing for our website, which does not use any framework. We use a few libraries, such as jQuery and Handlebars, but no frameworks like React or Vue. To do component testing, the Cypress app asks for a framework, however, and I don't see any option to select "none" or to skip this step. How can I proceed? Do I need to select one of the frameworks and then ignore it? Thanks!
handsome-wolf-98416
04/25/2023, 10:14 AM
Hi @best-flower-17510, this issue has now been "solved" in a way. I selected the Vue framework with the Vite bundler, installed all dependencies and added the Vue config file. However, I do find it quite striking that I need to add all this bloat that I don't need, just so I can unit test. Surely I'm not the only dev who doesn't use any 3rd-party framework? Are there any plans to add a simple "none" to the list of frameworks so that no dependencies are needed? Thanks!
e
elegant-scooter-88833
04/25/2023, 2:56 PM
@handsome-wolf-98416 The reason why we require these is because Component Testing is different from end-to-end testing as it ships with the dev server used to execute your tests. This means that it's necessary to have these dependencies installed so Cypress can run your Component Tests (not unit tests) in the run time Vue environment that your main app is using
elegant-scooter-88833
04/25/2023, 2:57 PM
I hope this answers your questions and concerns. Let me know if I can clarify anything any further
h
handsome-wolf-98416
04/26/2023, 5:11 AM
Hi @elegant-scooter-88833 thanks for the info. My main app is not running in a Vue environment, though. It's just a js file sitting on a server. What would be the best approach for unit testing then (short of using another platform)?
e
elegant-scooter-88833
04/26/2023, 12:25 PM
Hey @handsome-wolf-98416. You can certainly run unit tests using a tool like jest, or karma. IMO Component Tests are significantly more valuable tests but if you aren't really run Vue or a modern js framework than it might not be an option for you