test: fix timeago unit test (#1906)

This commit is contained in:
Nolan Lawson 2020-11-29 18:50:13 -08:00 committed by GitHub
parent 0022286b46
commit 6433a9c644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ const intlFormat = new Intl.RelativeTimeFormat(LOCALE)
function formatRelativeTime (number, index) { function formatRelativeTime (number, index) {
if (index === 0) { if (index === 0) {
if (process.env.NODE_ENV === 'test') { if (process.env.NODE_ENV === 'test') {
return require('../../../intl/en-US').justNow // only used in mocha tests return require('../../../intl/en-US').default.justNow // only used in mocha tests
} }
return 'intl.justNow' return 'intl.justNow'
} }