michaelwittig / node-i18n-iso-countries

i18n for ISO 3166-1 country codes
MIT License
816 stars 262 forks source link

Jest tests fails when upgrading to i18n-iso-countries 7.7.0 #336

Open NidalShaterM opened 1 year ago

NidalShaterM commented 1 year ago

we are using i18n-iso-countries in some functions and when the library is upgraded to 7.7.0, Jest tests are now failing like this:

 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

    232     country_code: getAlpha2Code(transactionInput.country.trim(), 'en'),

we pinned it to version 7.6.0 for now but would like for this issue to be resolved so we keep up with the updates

I guess this is caused by this commit https://github.com/michaelwittig/node-i18n-iso-countries/commit/287a1ae34d188069301f34202b6b43b5cb2a0d36#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8R21