Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise suggestion #54

Closed
AllenFang opened this issue Mar 12, 2018 · 3 comments · Fixed by #58
Closed

Promise suggestion #54

AllenFang opened this issue Mar 12, 2018 · 3 comments · Fixed by #58

Comments

@AllenFang
Copy link
Contributor

AllenFang commented Mar 12, 2018

Hey @jefflau

Preface

About Promise.finally is already going to stage 4, some promise library already support finally function.

Issue

Recently, I used finally with fetch in my code, everything is work well, but when I writing the test leverage by jest-fetch-mock, there's something wrong. Anyway, the modern browser's fetch already support finally except for Edge. you can try it easily on browser dev tool

Root cause

I think due to jest-fetch-mock still use native Promise so that some people will got above issue.

Do you consider to use promise-polyfill to fix this issue?, it's already support finally

Probably, I can try to fix this issue by a PR after your confirmation

@jefflau
Copy link
Owner

jefflau commented Mar 21, 2018

I'm open to this. Could you show me how you would implement it?

@AllenFang
Copy link
Contributor Author

hey jeff, I think it's not very difficult probably. We can just try to replace the Promise by promise-polyfill

@jefflau
Copy link
Owner

jefflau commented Mar 24, 2018

Sounds good!

AllenFang added a commit to AllenFang/jest-fetch-mock that referenced this issue Apr 1, 2018
jefflau added a commit that referenced this issue May 16, 2018
fix #54: allow Promise to support Promise.finally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants