mercredi 25 novembre 2020

Using Jest.js and a vanilla js?

I've written a tiny application in vanilla JS which has several functions that write/change the DOM.

I'd like to test this app with Jest, and am thinking that I'd need to attach and run imported js file to a fake DOM to write my tests against. However, I cannot work out how to do this, I've normally used Jest/Enzyme but as this is NOT a React app, I'm unsure how to proceed, and all my searches seem to assume React. Is this possible?

Aucun commentaire:

Enregistrer un commentaire