• Robert Knight's avatar
    Use mock `Intl` to test `formatDate` in tests · 3b9a71b3
    Robert Knight authored
    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.
    3b9a71b3
time-test.js 8 KB