Use mock `Intl` to test `formatDate` in tests
This uses the real `Intl.DateTimeFormat` API but with a fixed locale to ensure consistent output across systems. This is a more complete test than the previous one. The test assumes that output is consistent across browsers for the date given. In testing with Safari, Firefox and Chrome this was the case for the en-US locale. We accept some small risk that the exact format might change slightly in future releases of one of these browsers.
Showing
Please register or sign in to comment