jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
886 stars 117 forks source link

SyntaxError: Unexpected token << #91

Closed prymitive closed 5 years ago

prymitive commented 5 years ago

Looks like index.js code includes a left over line from a merge conflict https://github.com/jefflau/jest-fetch-mock/blob/master/src/index.js#L1 and because of that latest release doesn't work - https://travis-ci.com/prymitive/karma/jobs/157582009#L488

smoliakov commented 5 years ago

After installing jest-fetch-mock@1.7.0

There is a merge conflict result here node_modules/jest-fetch-mock/src/index.js

<<<<<<< HEAD
const crossFetch = require('cross-fetch')
global.fetch = crossFetch
global.Response = crossFetch.Response
global.Headers = crossFetch.Headers
global.Request = crossFetch.Request
=======
require('isomorphic-fetch')
>>>>>>> master
jefflau commented 5 years ago

Thanks, I made a mistake. I'll push a new one now

jefflau commented 5 years ago

I've pushed a fix - can you check it works correctly? Thanks!

reorg3 commented 5 years ago

Thanks @jefflau. Also, I have added a comment on your last commit. Please review.

jefflau commented 5 years ago

Thanks, I fixed that too

smoliakov commented 5 years ago

Yes, works fine for me, thanks!

reorg3 commented 5 years ago

Thanks. Do you also plan to add the yarn.lock file? @jefflau

prymitive commented 5 years ago

Looks good now, thanks

alexaivars commented 5 years ago

Might be a good idea to mark the 1.7.0 version as deprecated on npm. Our greenkeeper tried to install this and I guess marking it as deprecated would just make tools like this skip that version.

jefflau commented 5 years ago

Thanks, I've done that now