t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Using Jest along with SweetAlert2 in a React Application #833

Open fraser-uno opened 6 years ago

fraser-uno commented 6 years ago

Trying to run jest tests on a component that imports Sweetalert. I understand that I may need to use babel to be able to import and transform sweetalert correctly.

Can anyone assist me on this?

Error

capture

My application also uses webpack and has a babel configuration { "presets": ["env", "react", "stage-2"] }