-
Notifications
You must be signed in to change notification settings - Fork 104
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
feat: add RelativeTimeFormat to Intl API #479
feat: add RelativeTimeFormat to Intl API #479
Conversation
f66cd19
to
e640586
Compare
By mocking the Intl API, the RelativeTimeFormat object was missing. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
e640586
to
f4469bf
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #479 +/- ##
==========================================
+ Coverage 96.47% 96.48% +0.01%
==========================================
Files 2 2
Lines 680 682 +2
==========================================
+ Hits 656 658 +2
Misses 24 24
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like an OK interim solution.
Thanks for your reviews, what are the next steps? |
Hey folks, this issue doesn't allow me to update fake-timers, since it would break my production. |
Didn't want to close the PR, just comment on it |
Seems like you just need to implement your own suggestion that iterates over the props 🤩 PS. Nothing should ever prevent you from upgrading. Try the Npm package 'patch-package' next time ✌️ |
Since there's no compilation step in this repo, you can also depend on your fork directly |
I'm getting the same issue, but with edit: ok.. now I see this is actually doing that, so I probably need to wait for a release to happen? |
New version is out. |
Thanks! Sorry for hijacking this PR 😅 |
Purpose (TL;DR) - mandatory
PR #474 has introduced a mock for the intl API, and this has introduced a regression for me, where I'm not able to call
Intl.RelativeTimeFormat
.Background (Problem in detail)
The problem showed in some of my test cases, once I updated
fake-timers
, when trying to useIntl.RelativeTimeFormat
I got the following error:Intl.RelativeTimeFormat is not a constructor
Solution
The solution I opted for is to assign
RelativeTimeFormat
to the mockedIntl
API with.