djorg83 / react-bootstrap-sweetalert

A React implementation of SweetAlert
https://djorg83.github.io/react-bootstrap-sweetalert/
MIT License
252 stars 55 forks source link

Breaks tests with the default CRA setup #59

Closed mjetek closed 4 years ago

mjetek commented 4 years ago

Hi, The package which is published to npm is using import syntax and it breaks tests when your are using default setup created by create-react-app. I get this error when running tests which use react-bootstrap-sweetalert:

({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import SweetAlert from "./components/SweetAlert";
                                                                                             ^^^^^^

    SyntaxError: Cannot use import statement outside a module

I've created this simple example where you can see the issue https://github.com/mjetek/test-react-bootstrap-sweetalert

djorg83 commented 4 years ago

resolved with v5.1.9