I have a Jest test that checks the value of the input field containing currency. The number is formatted using global.Intl.NumberFormat like so:
const formatter = new global.Intl.NumberFormat(locale, config);
Where locale is set to nl-NL and config is
{ style: 'decimal',
currency: 'EUR',
minimumFractionDigits: 2,
maximumFractionDigits: 2 }
When I simulate input in my test, I get the US formatting for the number, even though in my browser it works just fine. For example, if I do
input.simulate('change', { target: { value: '5000' } });
I would get '5,000.00' formatting, where for Euro I should get '5.000,00'. It does the formatting, but not for the right locale. I wonder if Jest is mocking something for me and if so how can I turn this off? Any clues would be highly appreciated.