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

Uplift to intl-relativeformat 2.1.0 and Fix Unit Test #1090

Merged
merged 1 commit into from
Apr 18, 2018
Merged

Uplift to intl-relativeformat 2.1.0 and Fix Unit Test #1090

merged 1 commit into from
Apr 18, 2018

Conversation

papasmile
Copy link
Contributor

Intl Relative Format 2.1.0 included a change to supported formats [1]. Unit tests format.js include an exact string match to Intl Relative Format's error message, causing test to fail with:

Expected '[React Intl] Error formatting relative time.\nError: "invalid" is not a valid IntlRelativeFormat units value, it must be one of: "second", "second-short", "minute", "minute-short", "hour", "hour-short", "day", "day-short", "month", "month-short", "year", "year-short"' to be '[React Intl] Error formatting relative time.\nError: "invalid" is not a valid IntlRelativeFormat units value, it must be one of: "second", "minute", "hour", "day", "month", "year"'

This PR:

  • Uplifts minimum version of intl-relativeformat to 2.1.0
  • Fixes unit test by relaxing matching criteria to look at the beginning of the error message instead of entire message string.

Tested with:

  • npm run test
  • npm run lint
  • npm run test:react also passes, but uplifts several dependencies I don't have time to validate right now so not including those.

[1] formatjs/intl-relativeformat@d4b853f

@drewler
Copy link

drewler commented Mar 5, 2018

Thank you @papasmile, I was looking after the new short formats. It would be great to have this merged.

@okuryu could you check this please?

@redonkulus
Copy link
Member

@papasmile This isn't necessary since the ^ in the package.json will automatically pull in the latest minor version as well.

@papasmile
Copy link
Contributor Author

Hi, @redonkulus, sure, package.json change is not required, but test change is required or else it fails on 2.1.

@redonkulus
Copy link
Member

Makes sense 👍

@redonkulus redonkulus merged commit 763f3fc into formatjs:master Apr 18, 2018
@papasmile
Copy link
Contributor Author

thx

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 this pull request may close these issues.

None yet

3 participants