Skip to content

Commit d17ee2c

Browse files
author
mjolly
committed
fix: fix test
1 parent d023028 commit d17ee2c

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

packages/use-i18n/src/__tests__/__snapshots__/formatDate.test.ts.snap

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,36 @@ exports[`formatDate > should work with format "numericHour", for date = "new Dat
186186

187187
exports[`formatDate > should work with format "numericHour", for date = "new Date(2020, 1, 13, 16, 28)" and locale "ro" 1`] = `"2020-02-13 16:28"`;
188188

189+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "de" 1`] = `"13. Februar 2020 um 15:28:00"`;
190+
191+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "en" 1`] = `"February 13, 2020 at 3:28:00 PM"`;
192+
193+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "es" 1`] = `"13 de febrero de 2020, 15:28:00"`;
194+
195+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "fr" 1`] = `"13 février 2020 à 15:28:00"`;
196+
197+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "ro" 1`] = `"13 februarie 2020 la 15:28:00"`;
198+
199+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "de" 1`] = `"13. Februar 2020 um 15:28:00"`;
200+
201+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "en" 1`] = `"February 13, 2020 at 3:28:00 PM"`;
202+
203+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "es" 1`] = `"13 de febrero de 2020, 15:28:00"`;
204+
205+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "fr" 1`] = `"13 février 2020 à 15:28:00"`;
206+
207+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "ro" 1`] = `"13 februarie 2020 la 15:28:00"`;
208+
209+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "de" 1`] = `"13. Februar 2020 um 16:28:00"`;
210+
211+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "en" 1`] = `"February 13, 2020 at 4:28:00 PM"`;
212+
213+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "es" 1`] = `"13 de febrero de 2020, 16:28:00"`;
214+
215+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "fr" 1`] = `"13 février 2020 à 16:28:00"`;
216+
217+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "ro" 1`] = `"13 februarie 2020 la 16:28:00"`;
218+
189219
exports[`formatDate > should work with format "short", for date = "2020-02-13T15:28:00.000Z" and locale "de" 1`] = `"13. Feb. 2020"`;
190220

191221
exports[`formatDate > should work with format "short", for date = "2020-02-13T15:28:00.000Z" and locale "en" 1`] = `"Feb 13, 2020"`;

packages/use-i18n/src/__tests__/formatDate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('formatDate', () => {
7373
// @ts-expect-error we check a failing case
7474
formatDate('fr', 1581607680000, 'not a valid format'),
7575
).toThrowError(
76-
'format "not a valid format" should be one of hour, hourOnly, long, short, shortWithoutDay, numeric, numericHour or a valid Intl.DateTimeFormat options object',
76+
'format "not a valid format" should be one of second, hour, hourOnly, long, short, shortWithoutDay, numeric, numericHour or a valid Intl.DateTimeFormat options object',
7777
)
7878
})
7979
})

0 commit comments

Comments
 (0)