joetidee / enzyme-react-intl

A complimentary wrapper function for use with Enzyme, when testing React components that rely on react-intl
MIT License
45 stars 14 forks source link

Unable to use with PhantomJS #12

Closed markgillnz closed 6 years ago

markgillnz commented 6 years ago

I am using enzyme-react-intl to test react-intl components however it fails when used in combination with karma and PhantomJS 2.1.1

11 04 2018 15:28:58.283:INFO [framework.detect-browsers]: Detecting browsers is disabled. The browsers of the browsers array are used. 11 04 2018 15:29:05.248:INFO [framework.browserify]: bundle built 11 04 2018 15:29:05.297:INFO [karma]: Karma v0.13.22 server started at http://localhost:52917/ 11 04 2018 15:29:05.301:INFO [launcher]: Starting browser PhantomJS 11 04 2018 15:29:06.275:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket u9NSMuoySmC8soxnAAAA with id 69589497 PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR SyntaxError: Use of reserved word 'let' in strict mode at /var/folders/dj/s8jy53zn6sg7pvqf24g6pjgsp7527r/T/c41fd46be3a670f19e1228fa90cec6a0.browserify:12166 <- node_modules/enzyme-react-intl/lib/enzyme-react-intl.js:1:0

Can you suggest what I can do to get this working?

joetidee commented 6 years ago

Are you using the latest version of enzyme-react-int ?

markgillnz commented 6 years ago

Yes, I installed it yesterday

joetidee commented 6 years ago

Found this - does this help? https://github.com/domenic/chai-as-promised/issues/231

markgillnz commented 6 years ago

I have tried using karma-babel-preprocessor to compile it but to no avail. I will try with an updated version of karma later to see if it helps though